From 5cd2635e05c26e509c0158b8093f85f1ebad0aba Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:11:02 -0500 Subject: [PATCH 1/4] bug/renamed-columns-datespine --- CHANGELOG.md | 6 ++++ dbt_project.yml | 2 +- integration_tests/dbt_project.yml | 2 +- .../int_salesforce__date_spine.sql | 33 ++++++++++++------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84812e2..348f084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# dbt_salesforce v1.1.1 +[PR #56](https://github.com/fivetran/dbt_salesforce/pull/56) includes the following updates: +## Bugfix +- Updated the logic for model `int_salesforce__date_spine` to reference the `stg_*` staging models instead of the source tables. + - This was necessary since the staging models account for multiple spellings of column names while the source tables do not. + # dbt_salesforce v1.1.0 [PR #55](https://github.com/fivetran/dbt_salesforce/pull/55) includes the following updates: diff --git a/dbt_project.yml b/dbt_project.yml index 315223a..99a518b 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,6 +1,6 @@ config-version: 2 name: 'salesforce' -version: '1.1.0' +version: '1.1.1' require-dbt-version: [">=1.3.0", "<2.0.0"] models: salesforce: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index be25b5d..6e4b7f6 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'salesforce_integration_tests' -version: '1.1.0' +version: '1.1.1' config-version: 2 profile: 'integration_tests' diff --git a/models/salesforce/intermediate/int_salesforce__date_spine.sql b/models/salesforce/intermediate/int_salesforce__date_spine.sql index 552df28..1084356 100644 --- a/models/salesforce/intermediate/int_salesforce__date_spine.sql +++ b/models/salesforce/intermediate/int_salesforce__date_spine.sql @@ -1,6 +1,11 @@ +{% if var('salesforce__lead_enabled', True) -%} +-- depends_on: {{ var('lead') }} +{% else -%} +-- depends_on: {{ var('opportunity') }} +{% endif %} with spine as ( - {% if execute %} + {% if execute and flags.WHICH in ('run', 'build') %} {%- set first_date_query %} select @@ -9,14 +14,12 @@ with spine as ( cast({{ dbt.dateadd("month", -1, "current_date") }} as date) ) as min_date {% if var('salesforce__lead_enabled', True) %} - from {{ source('salesforce', 'lead') }} + from {{ var('lead') }} {% else %} - from {{ source('salesforce', 'opportunity') }} + from {{ var('opportunity') }} {% endif %} {% endset -%} - {%- set first_date = dbt_utils.get_single_value(first_date_query) %} - {% set last_date_query %} select coalesce( @@ -24,25 +27,31 @@ with spine as ( cast(current_date as date) ) as max_date {% if var('salesforce__lead_enabled', True) %} - from {{ source('salesforce', 'lead') }} + from {{ var('lead') }} {% else %} - from {{ source('salesforce', 'opportunity') }} + from {{ var('opportunity') }} {% endif %} {% endset -%} - {%- set last_date = dbt_utils.get_single_value(last_date_query) %} - {% else %} - {% set first_date = 'dbt.dateadd("month", -1, "current_date")' %} - {% set last_date = 'dbt.current_timestamp_backcompat()' %} + {%- set first_date_query%} + select cast({{ dbt.dateadd("month", -1, "current_date") }} as date) + {% endset -%} + + {% set last_date_query %} + select cast({{ dbt.current_timestamp_backcompat() }} as date) + {% endset -%} {% endif %} + {%- set first_date = dbt_utils.get_single_value(first_date_query) %} + {%- set last_date = dbt_utils.get_single_value(last_date_query) %} + {{ dbt_utils.date_spine( datepart="day", start_date="cast('" ~ first_date ~ "' as date)", - end_date=dbt.dateadd("day", 1, "cast('" ~ last_date ~ "' as date)") + end_date=dbt.dateadd('day', 1, "cast('" ~ last_date ~ "' as date)") ) }} ) From c9839e7024e29ed311902c5b9c2c6c8116889cf6 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:15:12 -0500 Subject: [PATCH 2/4] typo fix --- models/salesforce/intermediate/int_salesforce__date_spine.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/salesforce/intermediate/int_salesforce__date_spine.sql b/models/salesforce/intermediate/int_salesforce__date_spine.sql index 1084356..1641343 100644 --- a/models/salesforce/intermediate/int_salesforce__date_spine.sql +++ b/models/salesforce/intermediate/int_salesforce__date_spine.sql @@ -51,7 +51,7 @@ with spine as ( {{ dbt_utils.date_spine( datepart="day", start_date="cast('" ~ first_date ~ "' as date)", - end_date=dbt.dateadd('day', 1, "cast('" ~ last_date ~ "' as date)") + end_date=dbt.dateadd("day", 1, "cast('" ~ last_date ~ "' as date)") ) }} ) From 99ffac7faa31c92904e04f857071b69dc8bc8dee Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:35:45 -0500 Subject: [PATCH 3/4] regen docs --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- docs/run_results.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 4e15211..93771c2 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.8.3", "generated_at": "2024-07-10T00:47:41.492159Z", "invocation_id": "f1c358ba-eb11-4963-9644-4063866a3763", "env": {}}, "nodes": {"seed.salesforce_integration_tests.sf_account_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 2, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 4, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "text", "index": 7, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 8, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "double precision", "index": 9, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "double precision", "index": 10, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 11, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 12, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 13, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 14, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 15, "name": "description", "comment": null}, "fax": {"type": "integer", "index": 16, "name": "fax", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "industry": {"type": "text", "index": 18, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "jigsaw_company_id": {"type": "integer", "index": 20, "name": "jigsaw_company_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": null}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 31, "name": "photo_url", "comment": null}, "rating": {"type": "integer", "index": 32, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 33, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "double precision", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "double precision", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "integer", "index": 43, "name": "shipping_street", "comment": null}, "sic": {"type": "integer", "index": 44, "name": "sic", "comment": null}, "sic_desc": {"type": "integer", "index": 45, "name": "sic_desc", "comment": null}, "site": {"type": "integer", "index": 46, "name": "site", "comment": null}, "ticker_symbol": {"type": "integer", "index": 47, "name": "ticker_symbol", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "website": {"type": "text", "index": 49, "name": "website", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 50, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_account_data"}, "seed.salesforce_integration_tests.sf_account_history_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 5, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 6, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 7, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 8, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 9, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 10, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 11, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 13, "name": "description", "comment": null}, "id": {"type": "text", "index": 14, "name": "id", "comment": null}, "industry": {"type": "text", "index": 15, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 16, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 20, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 21, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 22, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 23, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 24, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 25, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 26, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 27, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 28, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 30, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 31, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 32, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 33, "name": "type", "comment": null}, "website": {"type": "text", "index": 34, "name": "website", "comment": null}}, "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.salesforce_integration_tests.sf_account_history_data"}, "seed.salesforce_integration_tests.sf_contact_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "cbit_clearbit_c": {"type": "text", "index": 4, "name": "cbit_clearbit_c", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 5, "name": "cbit_clearbit_ready_c", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "department": {"type": "integer", "index": 8, "name": "department", "comment": null}, "email": {"type": "text", "index": 9, "name": "email", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 10, "name": "email_bounced_date", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 11, "name": "email_bounced_reason", "comment": null}, "fax": {"type": "integer", "index": 12, "name": "fax", "comment": null}, "first_name": {"type": "text", "index": 13, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": null}, "is_email_bounced": {"type": "boolean", "index": 15, "name": "is_email_bounced", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 16, "name": "jigsaw_contact_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_curequest_date": {"type": "timestamp without time zone", "index": 18, "name": "last_curequest_date", "comment": null}, "last_cuupdate_date": {"type": "timestamp without time zone", "index": 19, "name": "last_cuupdate_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 22, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 25, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 26, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 27, "name": "mailing_country_code", "comment": null}, "mailing_geocode_accuracy": {"type": "integer", "index": 28, "name": "mailing_geocode_accuracy", "comment": null}, "mailing_latitude": {"type": "integer", "index": 29, "name": "mailing_latitude", "comment": null}, "mailing_longitude": {"type": "integer", "index": 30, "name": "mailing_longitude", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 31, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 32, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 33, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 34, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 35, "name": "master_record_id", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 36, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "mobile_phone": {"type": "integer", "index": 37, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 38, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 39, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 40, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 41, "name": "photo_url", "comment": null}, "reports_to_id": {"type": "integer", "index": 42, "name": "reports_to_id", "comment": null}, "salutation": {"type": "integer", "index": 43, "name": "salutation", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 44, "name": "system_modstamp", "comment": null}, "title": {"type": "text", "index": 45, "name": "title", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 46, "name": "email_bounced_c", "comment": null}, "email_quality_unknown_c": {"type": "boolean", "index": 47, "name": "email_quality_unknown_c", "comment": null}, "gclid_c": {"type": "integer", "index": 48, "name": "gclid_c", "comment": null}, "referral_account_c": {"type": "integer", "index": 49, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 50, "name": "referral_contact_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 51, "name": "has_opted_out_of_email", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 52, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 53, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 54, "name": "fivetran_user_id_c", "comment": null}, "no_longer_at_company_c": {"type": "boolean", "index": 55, "name": "no_longer_at_company_c", "comment": null}, "pi_campaign_c": {"type": "text", "index": 56, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 57, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 58, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 59, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 60, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "timestamp without time zone", "index": 61, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 62, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 63, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 64, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 65, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 66, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 67, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "boolean", "index": 68, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 69, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "boolean", "index": 70, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 71, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 72, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "text", "index": 73, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 74, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 75, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 76, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 77, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 78, "name": "pi_utm_term_c", "comment": null}, "lead_source": {"type": "text", "index": 79, "name": "lead_source", "comment": null}, "contact_status_c": {"type": "text", "index": 80, "name": "contact_status_c", "comment": null}, "region_c": {"type": "integer", "index": 81, "name": "region_c", "comment": null}, "competitor_c": {"type": "integer", "index": 82, "name": "competitor_c", "comment": null}, "bt_stripe_gender_c": {"type": "integer", "index": 83, "name": "bt_stripe_gender_c", "comment": null}, "bt_stripe_ssn_last_4_encrypted_c": {"type": "integer", "index": 84, "name": "bt_stripe_ssn_last_4_encrypted_c", "comment": null}, "bt_stripe_personal_id_number_c": {"type": "integer", "index": 85, "name": "bt_stripe_personal_id_number_c", "comment": null}, "bt_stripe_personal_id_number_encrypted_c": {"type": "integer", "index": 86, "name": "bt_stripe_personal_id_number_encrypted_c", "comment": null}, "bt_stripe_maiden_name_c": {"type": "integer", "index": 87, "name": "bt_stripe_maiden_name_c", "comment": null}, "bt_stripe_languages_c": {"type": "integer", "index": 88, "name": "bt_stripe_languages_c", "comment": null}, "bt_stripe_default_payment_method_c": {"type": "integer", "index": 89, "name": "bt_stripe_default_payment_method_c", "comment": null}, "bt_stripe_ssn_last_4_c": {"type": "integer", "index": 90, "name": "bt_stripe_ssn_last_4_c", "comment": null}, "bt_stripe_personal_id_type_c": {"type": "integer", "index": 91, "name": "bt_stripe_personal_id_type_c", "comment": null}, "bt_stripe_default_payment_gateway_c": {"type": "integer", "index": 92, "name": "bt_stripe_default_payment_gateway_c", "comment": null}, "bt_stripe_level_c": {"type": "integer", "index": 93, "name": "bt_stripe_level_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 94, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 95, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 96, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 97, "name": "lean_data_tag_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 98, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 99, "name": "do_not_route_lead_c", "comment": null}, "technical_contact_c": {"type": "integer", "index": 100, "name": "technical_contact_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 101, "name": "allbound_id_c", "comment": null}, "notes_c": {"type": "integer", "index": 102, "name": "notes_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 103, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 104, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 105, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 106, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 107, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_pushed_from_opportunity_c": {"type": "boolean", "index": 108, "name": "netsuite_conn_pushed_from_opportunity_c", "comment": null}, "description": {"type": "text", "index": 109, "name": "description", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 110, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 111, "name": "lid_linked_in_member_token_c", "comment": null}, "is_eu_resident_c": {"type": "boolean", "index": 112, "name": "is_eu_resident_c", "comment": null}, "do_not_call": {"type": "boolean", "index": 113, "name": "do_not_call", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 114, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 115, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 116, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "source_detail_c": {"type": "text", "index": 117, "name": "source_detail_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 118, "name": "utm_source_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 119, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 120, "name": "utm_term_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 121, "name": "utm_medium_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 122, "name": "utm_campaign_c", "comment": null}, "network_c": {"type": "integer", "index": 123, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 124, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 125, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 126, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 127, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 128, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 129, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 130, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 131, "name": "partner_rep_name_c", "comment": null}, "contact_type_c": {"type": "integer", "index": 132, "name": "contact_type_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 133, "name": "old_lead_source_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 134, "name": "old_lead_source_detail_c", "comment": null}, "contact_stage_c": {"type": "integer", "index": 135, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 136, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 137, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 138, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 139, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 140, "name": "original_utm_term_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 141, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 142, "name": "es_app_esecid_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 143, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 144, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 145, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 146, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 147, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 148, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 149, "name": "es_app_essource_c", "comment": null}, "individual_id": {"type": "integer", "index": 150, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 151, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 152, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 153, "name": "user_gems_has_changed_job_c", "comment": null}, "email_opt_in_explicit_c": {"type": "integer", "index": 154, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "integer", "index": 155, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "integer", "index": 156, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "integer", "index": 157, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 158, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 159, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 160, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 161, "name": "user_gems_past_title_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 162, "name": "partner_contact_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 163, "name": "promotion_id_c", "comment": null}, "referral_exists_c": {"type": "integer", "index": 164, "name": "referral_exists_c", "comment": null}, "referral_first_name_c": {"type": "integer", "index": 165, "name": "referral_first_name_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 166, "name": "referral_last_name_c", "comment": null}, "mkto_71_contact_acquisition_date_c": {"type": "integer", "index": 167, "name": "mkto_71_contact_acquisition_date_c", "comment": null}, "mkto_71_contact_acquisition_program_c": {"type": "integer", "index": 168, "name": "mkto_71_contact_acquisition_program_c", "comment": null}, "mkto_71_contact_acquisition_program_id_c": {"type": "integer", "index": 169, "name": "mkto_71_contact_acquisition_program_id_c", "comment": null}, "mkto_71_contact_inferred_city_c": {"type": "integer", "index": 170, "name": "mkto_71_contact_inferred_city_c", "comment": null}, "mkto_71_contact_inferred_company_c": {"type": "integer", "index": 171, "name": "mkto_71_contact_inferred_company_c", "comment": null}, "mkto_71_contact_inferred_country_c": {"type": "integer", "index": 172, "name": "mkto_71_contact_inferred_country_c", "comment": null}, "mkto_71_contact_inferred_metropolitan_a_c": {"type": "integer", "index": 173, "name": "mkto_71_contact_inferred_metropolitan_a_c", "comment": null}, "mkto_71_contact_inferred_phone_area_cod_c": {"type": "integer", "index": 174, "name": "mkto_71_contact_inferred_phone_area_cod_c", "comment": null}, "mkto_71_contact_inferred_postal_code_c": {"type": "integer", "index": 175, "name": "mkto_71_contact_inferred_postal_code_c", "comment": null}, "mkto_71_contact_inferred_state_region_c": {"type": "integer", "index": 176, "name": "mkto_71_contact_inferred_state_region_c", "comment": null}, "mkto_71_contact_lead_score_c": {"type": "integer", "index": 177, "name": "mkto_71_contact_lead_score_c", "comment": null}, "mkto_71_contact_original_referrer_c": {"type": "integer", "index": 178, "name": "mkto_71_contact_original_referrer_c", "comment": null}, "mkto_71_contact_original_search_engine_c": {"type": "integer", "index": 179, "name": "mkto_71_contact_original_search_engine_c", "comment": null}, "mkto_71_contact_original_search_phrase_c": {"type": "integer", "index": 180, "name": "mkto_71_contact_original_search_phrase_c", "comment": null}, "mkto_71_contact_original_source_info_c": {"type": "integer", "index": 181, "name": "mkto_71_contact_original_source_info_c", "comment": null}, "mkto_71_contact_original_source_type_c": {"type": "integer", "index": 182, "name": "mkto_71_contact_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 183, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "integer", "index": 184, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "integer", "index": 185, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "integer", "index": 186, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "integer", "index": 187, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_mkto_lead_score_c": {"type": "integer", "index": 188, "name": "mkto_si_mkto_lead_score_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 189, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 190, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 191, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ces_c": {"type": "integer", "index": 192, "name": "cloudingo_agent_ces_c", "comment": null}, "cloudingo_agent_mar_c": {"type": "integer", "index": 193, "name": "cloudingo_agent_mar_c", "comment": null}, "cloudingo_agent_mas_c": {"type": "integer", "index": 194, "name": "cloudingo_agent_mas_c", "comment": null}, "cloudingo_agent_mav_c": {"type": "integer", "index": 195, "name": "cloudingo_agent_mav_c", "comment": null}, "cloudingo_agent_mrdi_c": {"type": "integer", "index": 196, "name": "cloudingo_agent_mrdi_c", "comment": null}, "cloudingo_agent_mtz_c": {"type": "integer", "index": 197, "name": "cloudingo_agent_mtz_c", "comment": null}, "cloudingo_agent_oar_c": {"type": "integer", "index": 198, "name": "cloudingo_agent_oar_c", "comment": null}, "cloudingo_agent_oas_c": {"type": "integer", "index": 199, "name": "cloudingo_agent_oas_c", "comment": null}, "cloudingo_agent_oav_c": {"type": "integer", "index": 200, "name": "cloudingo_agent_oav_c", "comment": null}, "cloudingo_agent_ordi_c": {"type": "integer", "index": 201, "name": "cloudingo_agent_ordi_c", "comment": null}, "cloudingo_agent_otz_c": {"type": "integer", "index": 202, "name": "cloudingo_agent_otz_c", "comment": null}, "do_not_sync_marketo_c": {"type": "integer", "index": 203, "name": "do_not_sync_marketo_c", "comment": null}, "phone_extension_c": {"type": "integer", "index": 204, "name": "phone_extension_c", "comment": null}, "job_function_c": {"type": "integer", "index": 205, "name": "job_function_c", "comment": null}, "job_level_c": {"type": "integer", "index": 206, "name": "job_level_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 207, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 208, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 209, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 210, "name": "state_c", "comment": null}, "secondary_email_c": {"type": "integer", "index": 211, "name": "secondary_email_c", "comment": null}, "es_seniority_c": {"type": "integer", "index": 212, "name": "es_seniority_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 213, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 214, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 215, "name": "source_last_lead_source_detail_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 216, "name": "drift_cql_c", "comment": null}, "hot_contact_c": {"type": "integer", "index": 217, "name": "hot_contact_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 218, "name": "behavioral_score_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 219, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "integer", "index": 220, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 221, "name": "csi_code_c", "comment": null}, "clearbit_role_c": {"type": "integer", "index": 222, "name": "clearbit_role_c", "comment": null}, "clearbit_seniority_c": {"type": "integer", "index": 223, "name": "clearbit_seniority_c", "comment": null}, "clearbit_sub_role_c": {"type": "integer", "index": 224, "name": "clearbit_sub_role_c", "comment": null}, "rh_2_currency_test_c": {"type": "integer", "index": 225, "name": "rh_2_currency_test_c", "comment": null}, "rh_2_describe_c": {"type": "integer", "index": 226, "name": "rh_2_describe_c", "comment": null}, "rh_2_integer_test_c": {"type": "integer", "index": 227, "name": "rh_2_integer_test_c", "comment": null}, "created_by_role_c": {"type": "integer", "index": 228, "name": "created_by_role_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 229, "name": "demographic_score_c", "comment": null}, "country_code_c": {"type": "integer", "index": 230, "name": "country_code_c", "comment": null}, "state_code_c": {"type": "integer", "index": 231, "name": "state_code_c", "comment": null}, "attended_event_c": {"type": "integer", "index": 232, "name": "attended_event_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 233, "name": "zoominfo_technologies_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 234, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 235, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 236, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 237, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 238, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 239, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "integer", "index": 240, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 241, "name": "first_mql_date_c", "comment": null}, "active_relationship_c": {"type": "integer", "index": 242, "name": "active_relationship_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 243, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 244, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 245, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 246, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 247, "name": "clarus_status_c", "comment": null}, "historical_contact_status_c": {"type": "integer", "index": 248, "name": "historical_contact_status_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 249, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 250, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "integer", "index": 251, "name": "mql_reason_c", "comment": null}, "attempting_contact_date_time_c": {"type": "integer", "index": 252, "name": "attempting_contact_date_time_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 253, "name": "linked_in_url_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 254, "name": "trial_contact_start_date_c", "comment": null}, "contact_holdover_c": {"type": "integer", "index": 255, "name": "contact_holdover_c", "comment": null}, "bill_to_contact_hidden_c": {"type": "integer", "index": 256, "name": "bill_to_contact_hidden_c", "comment": null}, "enrichment_request_c": {"type": "integer", "index": 257, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "integer", "index": 258, "name": "meta_data_create_date_c", "comment": null}, "primary_se_c": {"type": "integer", "index": 259, "name": "primary_se_c", "comment": null}, "unqualified_reason_c": {"type": "integer", "index": 260, "name": "unqualified_reason_c", "comment": null}, "opp_handoff_ae_c": {"type": "integer", "index": 261, "name": "opp_handoff_ae_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 262, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 263, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 264, "name": "salesloft_cadence_trigger_c", "comment": null}, "last_ae_activity_owner_c": {"type": "integer", "index": 265, "name": "last_ae_activity_owner_c", "comment": null}, "last_bdr_activity_owner_c": {"type": "integer", "index": 266, "name": "last_bdr_activity_owner_c", "comment": null}, "last_manual_ae_activity_date_c": {"type": "integer", "index": 267, "name": "last_manual_ae_activity_date_c", "comment": null}, "last_manual_bdr_activity_date_c": {"type": "integer", "index": 268, "name": "last_manual_bdr_activity_date_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 269, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "integer", "index": 270, "name": "potential_fivetran_use_case_c", "comment": null}, "lean_data_router_completion_date_time_c": {"type": "integer", "index": 271, "name": "lean_data_router_completion_date_time_c", "comment": null}, "partner_territory_c": {"type": "integer", "index": 272, "name": "partner_territory_c", "comment": null}, "partner_company_c": {"type": "integer", "index": 273, "name": "partner_company_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 274, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 275, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 276, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 277, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 278, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 279, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 280, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 281, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 282, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 283, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 284, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "integer", "index": 285, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 286, "name": "sales_email_opt_out_date_time_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 287, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 288, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_net_suite_sync_error_c": {"type": "integer", "index": 289, "name": "celigo_sfnsio_net_suite_sync_error_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "integer", "index": 290, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "integer", "index": 291, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 292, "name": "ironclad_workflow_c", "comment": null}, "last_sales_activity_date_time_c": {"type": "integer", "index": 293, "name": "last_sales_activity_date_time_c", "comment": null}, "user_activity_logged_by_c": {"type": "integer", "index": 294, "name": "user_activity_logged_by_c", "comment": null}, "first_activity_after_mql_date_c": {"type": "integer", "index": 295, "name": "first_activity_after_mql_date_c", "comment": null}, "last_sdr_activity_owner_c": {"type": "integer", "index": 296, "name": "last_sdr_activity_owner_c", "comment": null}, "last_sdr_activity_date_c": {"type": "integer", "index": 297, "name": "last_sdr_activity_date_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 298, "name": "beta_connector_interest_c", "comment": null}, "first_manual_activity_after_mql_date_c": {"type": "integer", "index": 299, "name": "first_manual_activity_after_mql_date_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 300, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 301, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "integer", "index": 302, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 303, "name": "free_trial_email_confirmed_date_c", "comment": null}, "routed_from_manual_bdr_ae_activity_c": {"type": "integer", "index": 304, "name": "routed_from_manual_bdr_ae_activity_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 305, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "i_sell_avention_id_c": {"type": "integer", "index": 306, "name": "i_sell_avention_id_c", "comment": null}, "persona_c": {"type": "integer", "index": 307, "name": "persona_c", "comment": null}, "last_marketing_interesting_moment_date_c": {"type": "integer", "index": 308, "name": "last_marketing_interesting_moment_date_c", "comment": null}, "verified_c": {"type": "integer", "index": 309, "name": "verified_c", "comment": null}, "salesloft_owner_c": {"type": "integer", "index": 310, "name": "salesloft_owner_c", "comment": null}, "salesloft_owner_sf_c": {"type": "integer", "index": 311, "name": "salesloft_owner_sf_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 312, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_primary_role_c": {"type": "integer", "index": 313, "name": "pbf_startup_primary_role_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "integer", "index": 314, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 315, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 316, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 317, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 318, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 319, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 320, "name": "engagio_role_c", "comment": null}, "mql_date_changed_c": {"type": "integer", "index": 321, "name": "mql_date_changed_c", "comment": null}, "first_activity_after_mql_changed_c": {"type": "integer", "index": 322, "name": "first_activity_after_mql_changed_c", "comment": null}, "birthdate": {"type": "timestamp without time zone", "index": 323, "name": "birthdate", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 324, "name": "legacy_hvr_id_c", "comment": null}, "has_opted_out_of_fax": {"type": "integer", "index": 325, "name": "has_opted_out_of_fax", "comment": null}, "other_latitude": {"type": "integer", "index": 326, "name": "other_latitude", "comment": null}, "username_c": {"type": "integer", "index": 327, "name": "username_c", "comment": null}, "assistant_name": {"type": "integer", "index": 328, "name": "assistant_name", "comment": null}, "created_at_c": {"type": "integer", "index": 329, "name": "created_at_c", "comment": null}, "partner_contact_deprecate_c": {"type": "integer", "index": 330, "name": "partner_contact_deprecate_c", "comment": null}, "other_street": {"type": "integer", "index": 331, "name": "other_street", "comment": null}, "other_state": {"type": "integer", "index": 332, "name": "other_state", "comment": null}, "home_phone": {"type": "integer", "index": 333, "name": "home_phone", "comment": null}, "other_city": {"type": "integer", "index": 334, "name": "other_city", "comment": null}, "company_c": {"type": "integer", "index": 335, "name": "company_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 336, "name": "opportunity_c", "comment": null}, "hvr_update_c": {"type": "integer", "index": 337, "name": "hvr_update_c", "comment": null}, "other_phone": {"type": "integer", "index": 338, "name": "other_phone", "comment": null}, "other_geocode_accuracy": {"type": "integer", "index": 339, "name": "other_geocode_accuracy", "comment": null}, "other_postal_code": {"type": "integer", "index": 340, "name": "other_postal_code", "comment": null}, "other_country": {"type": "integer", "index": 341, "name": "other_country", "comment": null}, "assistant_phone": {"type": "integer", "index": 342, "name": "assistant_phone", "comment": null}, "jigsaw": {"type": "integer", "index": 343, "name": "jigsaw", "comment": null}, "avatar_c": {"type": "integer", "index": 344, "name": "avatar_c", "comment": null}, "other_longitude": {"type": "integer", "index": 345, "name": "other_longitude", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 346, "name": "lean_data_status_info_c", "comment": null}, "analytics_id_c": {"type": "integer", "index": 347, "name": "analytics_id_c", "comment": null}, "dnb_primary_address_postal_code_c": {"type": "integer", "index": 348, "name": "dnb_primary_address_postal_code_c", "comment": null}, "dnb_contact_phone_c": {"type": "integer", "index": 349, "name": "dnb_contact_phone_c", "comment": null}, "dnb_email_deliverability_score_c": {"type": "integer", "index": 350, "name": "dnb_email_deliverability_score_c", "comment": null}, "dnb_job_title_c": {"type": "integer", "index": 351, "name": "dnb_job_title_c", "comment": null}, "dnb_email_c": {"type": "integer", "index": 352, "name": "dnb_email_c", "comment": null}, "dnb_primary_address_city_c": {"type": "integer", "index": 353, "name": "dnb_primary_address_city_c", "comment": null}, "dnb_phone_accuracy_score_c": {"type": "integer", "index": 354, "name": "dnb_phone_accuracy_score_c", "comment": null}, "dnb_primary_address_state_province_c": {"type": "integer", "index": 355, "name": "dnb_primary_address_state_province_c", "comment": null}, "dnb_primary_address_state_province_abbre_c": {"type": "integer", "index": 356, "name": "dnb_primary_address_state_province_abbre_c", "comment": null}, "dnb_primary_address_country_region_code_c": {"type": "integer", "index": 357, "name": "dnb_primary_address_country_region_code_c", "comment": null}, "email_opt_in_double_c": {"type": "integer", "index": 358, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 359, "name": "phone_number_catch_all_c", "comment": null}, "contact_owners_manager_stamped_c": {"type": "integer", "index": 360, "name": "contact_owners_manager_stamped_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 361, "name": "fivetran_account_id_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 362, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 363, "name": "utm_id_c", "comment": null}, "self_service_routing_c": {"type": "integer", "index": 364, "name": "self_service_routing_c", "comment": null}, "no_geo_data_c": {"type": "integer", "index": 365, "name": "no_geo_data_c", "comment": null}, "to_be_deleted_salesloft_backfill_c": {"type": "integer", "index": 366, "name": "to_be_deleted_salesloft_backfill_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 367, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 368, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_contact_data"}, "seed.salesforce_integration_tests.sf_contact_history_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 6, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 7, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 8, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 10, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 13, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 14, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 16, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 17, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 18, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 19, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 20, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 21, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 22, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 23, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 24, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 26, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 27, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 30, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 31, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 32, "name": "home_phone", "comment": null}}, "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.salesforce_integration_tests.sf_contact_history_data"}, "seed.salesforce_integration_tests.sf_event_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "duration_in_minutes": {"type": "integer", "index": 9, "name": "duration_in_minutes", "comment": null}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": null}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": null}, "group_event_type": {"type": "integer", "index": 12, "name": "group_event_type", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 13, "name": "invitee_uuid_c", "comment": null}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": null}, "is_private": {"type": "boolean", "index": 17, "name": "is_private", "comment": null}, "is_recurrence": {"type": "boolean", "index": 18, "name": "is_recurrence", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 19, "name": "is_reminder_set", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "location": {"type": "integer", "index": 22, "name": "location", "comment": null}, "no_show_c": {"type": "boolean", "index": 23, "name": "no_show_c", "comment": null}, "owner_id": {"type": "text", "index": 24, "name": "owner_id", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 25, "name": "recurrence_activity_id", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 26, "name": "recurrence_day_of_month", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 27, "name": "recurrence_day_of_week_mask", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 28, "name": "recurrence_end_date_only", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "recurrence_interval": {"type": "integer", "index": 30, "name": "recurrence_interval", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 31, "name": "recurrence_month_of_year", "comment": null}, "recurrence_start_date_time": {"type": "timestamp without time zone", "index": 32, "name": "recurrence_start_date_time", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 33, "name": "recurrence_time_zone_sid_key", "comment": null}, "recurrence_type": {"type": "integer", "index": 34, "name": "recurrence_type", "comment": null}, "referral_account_c": {"type": "integer", "index": 35, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 36, "name": "referral_contact_c", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 37, "name": "reminder_date_time", "comment": null}, "show_as": {"type": "text", "index": 38, "name": "show_as", "comment": null}, "start_date_time": {"type": "timestamp without time zone", "index": 39, "name": "start_date_time", "comment": null}, "subject": {"type": "text", "index": 40, "name": "subject", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 41, "name": "system_modstamp", "comment": null}, "type": {"type": "text", "index": 42, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 43, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 44, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 45, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 46, "name": "who_id", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 47, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 48, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 49, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 50, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 52, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 53, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 54, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 55, "name": "lid_date_sent_c", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "is_recurrence_2": {"type": "boolean", "index": 78, "name": "is_recurrence_2", "comment": null}, "is_recurrence_2_exception": {"type": "boolean", "index": 79, "name": "is_recurrence_2_exception", "comment": null}, "is_recurrence_2_exclusion": {"type": "boolean", "index": 80, "name": "is_recurrence_2_exclusion", "comment": null}, "recurrence_2_pattern_start_date": {"type": "timestamp without time zone", "index": 81, "name": "recurrence_2_pattern_start_date", "comment": null}, "recurrence_2_pattern_text": {"type": "integer", "index": 82, "name": "recurrence_2_pattern_text", "comment": null}, "recurrence_2_pattern_time_zone": {"type": "integer", "index": 83, "name": "recurrence_2_pattern_time_zone", "comment": null}, "recurrence_2_pattern_version": {"type": "integer", "index": 84, "name": "recurrence_2_pattern_version", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 85, "name": "co_selling_activity_c", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 86, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 87, "name": "partner_contact_c", "comment": null}, "description_c": {"type": "integer", "index": 88, "name": "description_c", "comment": null}, "campaign_c": {"type": "integer", "index": 89, "name": "campaign_c", "comment": null}, "event_name_c": {"type": "integer", "index": 90, "name": "event_name_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 91, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 92, "name": "topic_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 93, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 94, "name": "partner_activity_type_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 95, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 96, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 97, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 98, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 99, "name": "vidyard_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 100, "name": "collections_hold_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 101, "name": "execute_collections_plan_activity_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 102, "name": "expected_payment_date_c", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 103, "name": "end_date", "comment": null}, "opportunity_c": {"type": "integer", "index": 104, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "integer", "index": 105, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "integer", "index": 106, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 107, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 108, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "integer", "index": 109, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "integer", "index": 110, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 111, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 112, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 113, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_event_data"}, "seed.salesforce_integration_tests.sf_lead_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"country": {"type": "integer", "index": 1, "name": "country", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 2, "name": "email_bounced_reason", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 3, "name": "email_bounced_date", "comment": null}, "owner_id": {"type": "text", "index": 4, "name": "owner_id", "comment": null}, "secondary_email_c": {"type": "integer", "index": 5, "name": "secondary_email_c", "comment": null}, "lead_source": {"type": "integer", "index": 6, "name": "lead_source", "comment": null}, "converted_date": {"type": "timestamp without time zone", "index": 7, "name": "converted_date", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": null}, "master_record_id": {"type": "integer", "index": 9, "name": "master_record_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 12, "name": "geocode_accuracy", "comment": null}, "converted_contact_id": {"type": "text", "index": 13, "name": "converted_contact_id", "comment": null}, "up_region_c": {"type": "integer", "index": 14, "name": "up_region_c", "comment": null}, "id": {"type": "text", "index": 15, "name": "id", "comment": null}, "photo_url": {"type": "text", "index": 16, "name": "photo_url", "comment": null}, "state": {"type": "integer", "index": 17, "name": "state", "comment": null}, "longitude": {"type": "integer", "index": 18, "name": "longitude", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 19, "name": "last_referenced_date", "comment": null}, "up_district_c": {"type": "integer", "index": 20, "name": "up_district_c", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "country_code": {"type": "integer", "index": 22, "name": "country_code", "comment": null}, "phone": {"type": "integer", "index": 23, "name": "phone", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 24, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 26, "name": "jigsaw_contact_id", "comment": null}, "lead_source_detail_c": {"type": "integer", "index": 27, "name": "lead_source_detail_c", "comment": null}, "created_by_id": {"type": "text", "index": 28, "name": "created_by_id", "comment": null}, "salutation": {"type": "integer", "index": 29, "name": "salutation", "comment": null}, "is_converted": {"type": "boolean", "index": 30, "name": "is_converted", "comment": null}, "state_code": {"type": "integer", "index": 31, "name": "state_code", "comment": null}, "is_unread_by_owner": {"type": "boolean", "index": 32, "name": "is_unread_by_owner", "comment": null}, "status": {"type": "text", "index": 33, "name": "status", "comment": null}, "city": {"type": "integer", "index": 34, "name": "city", "comment": null}, "latitude": {"type": "integer", "index": 35, "name": "latitude", "comment": null}, "cbit_clearbit_c": {"type": "integer", "index": 36, "name": "cbit_clearbit_c", "comment": null}, "industry": {"type": "text", "index": 37, "name": "industry", "comment": null}, "title": {"type": "integer", "index": 38, "name": "title", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 39, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 40, "name": "last_viewed_date", "comment": null}, "converted_opportunity_id": {"type": "integer", "index": 41, "name": "converted_opportunity_id", "comment": null}, "is_deleted": {"type": "boolean", "index": 42, "name": "is_deleted", "comment": null}, "street": {"type": "integer", "index": 43, "name": "street", "comment": null}, "company": {"type": "text", "index": 44, "name": "company", "comment": null}, "first_name": {"type": "text", "index": 45, "name": "first_name", "comment": null}, "email": {"type": "text", "index": 46, "name": "email", "comment": null}, "website": {"type": "integer", "index": 47, "name": "website", "comment": null}, "last_name": {"type": "text", "index": 48, "name": "last_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 49, "name": "number_of_employees", "comment": null}, "up_territory_c": {"type": "integer", "index": 50, "name": "up_territory_c", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 51, "name": "created_date", "comment": null}, "gclid_c": {"type": "integer", "index": 52, "name": "gclid_c", "comment": null}, "active_in_sequence_c": {"type": "boolean", "index": 53, "name": "active_in_sequence_c", "comment": null}, "postal_code": {"type": "integer", "index": 54, "name": "postal_code", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 55, "name": "cbit_clearbit_ready_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 56, "name": "has_opted_out_of_email", "comment": null}, "converted_account_id": {"type": "text", "index": 57, "name": "converted_account_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 58, "name": "mobile_phone", "comment": null}, "calendly_created_c": {"type": "integer", "index": 59, "name": "calendly_created_c", "comment": null}, "account_c": {"type": "integer", "index": 60, "name": "account_c", "comment": null}, "all_connectors_c": {"type": "integer", "index": 61, "name": "all_connectors_c", "comment": null}, "all_data_warehouses_c": {"type": "integer", "index": 62, "name": "all_data_warehouses_c", "comment": null}, "bi_tools_c": {"type": "integer", "index": 63, "name": "bi_tools_c", "comment": null}, "competitors_c": {"type": "integer", "index": 64, "name": "competitors_c", "comment": null}, "annual_revenue": {"type": "integer", "index": 65, "name": "annual_revenue", "comment": null}, "connectors_products_c": {"type": "integer", "index": 66, "name": "connectors_products_c", "comment": null}, "contact_c": {"type": "integer", "index": 67, "name": "contact_c", "comment": null}, "data_warehouse_products_c": {"type": "integer", "index": 68, "name": "data_warehouse_products_c", "comment": null}, "notes_c": {"type": "integer", "index": 69, "name": "notes_c", "comment": null}, "timeframe_c": {"type": "integer", "index": 70, "name": "timeframe_c", "comment": null}, "account_all_products_c": {"type": "integer", "index": 71, "name": "account_all_products_c", "comment": null}, "account_bi_tools_c": {"type": "integer", "index": 72, "name": "account_bi_tools_c", "comment": null}, "account_data_warehouses_c": {"type": "integer", "index": 73, "name": "account_data_warehouses_c", "comment": null}, "opportunity_competitors_c": {"type": "integer", "index": 74, "name": "opportunity_competitors_c", "comment": null}, "opportunity_products_c": {"type": "integer", "index": 75, "name": "opportunity_products_c", "comment": null}, "description": {"type": "integer", "index": 76, "name": "description", "comment": null}, "referral_account_c": {"type": "integer", "index": 77, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 78, "name": "referral_contact_c", "comment": null}, "volume_in_millions_c": {"type": "integer", "index": 79, "name": "volume_in_millions_c", "comment": null}, "feature_requests_c": {"type": "integer", "index": 80, "name": "feature_requests_c", "comment": null}, "lead_number_c": {"type": "integer", "index": 81, "name": "lead_number_c", "comment": null}, "demo_scheduled_by_calenderly_c": {"type": "boolean", "index": 82, "name": "demo_scheduled_by_calenderly_c", "comment": null}, "to_delete_c": {"type": "boolean", "index": 83, "name": "to_delete_c", "comment": null}, "bounced_email_c": {"type": "integer", "index": 84, "name": "bounced_email_c", "comment": null}, "email_quality_c": {"type": "boolean", "index": 85, "name": "email_quality_c", "comment": null}, "email_quality_catchall_c": {"type": "integer", "index": 86, "name": "email_quality_catchall_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 87, "name": "old_lead_source_c", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 88, "name": "email_bounced_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 89, "name": "old_lead_source_detail_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 90, "name": "utm_medium_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 91, "name": "utm_source_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 92, "name": "utm_campaign_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 93, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 94, "name": "utm_term_c", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 95, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 96, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 97, "name": "fivetran_user_id_c", "comment": null}, "geo_state_acton_c": {"type": "integer", "index": 98, "name": "geo_state_acton_c", "comment": null}, "actoncountry_c": {"type": "integer", "index": 99, "name": "actoncountry_c", "comment": null}, "actoncity_c": {"type": "integer", "index": 100, "name": "actoncity_c", "comment": null}, "actoncountrycode_c": {"type": "integer", "index": 101, "name": "actoncountrycode_c", "comment": null}, "actonpostalcode_c": {"type": "integer", "index": 102, "name": "actonpostalcode_c", "comment": null}, "actonreferrer_c": {"type": "integer", "index": 103, "name": "actonreferrer_c", "comment": null}, "actonstate_c": {"type": "integer", "index": 104, "name": "actonstate_c", "comment": null}, "geo_city_c": {"type": "integer", "index": 105, "name": "geo_city_c", "comment": null}, "geo_country_c": {"type": "integer", "index": 106, "name": "geo_country_c", "comment": null}, "geo_country_code_c": {"type": "integer", "index": 107, "name": "geo_country_code_c", "comment": null}, "geo_postal_code_c": {"type": "integer", "index": 108, "name": "geo_postal_code_c", "comment": null}, "geo_state_c": {"type": "integer", "index": 109, "name": "geo_state_c", "comment": null}, "company_type_c": {"type": "integer", "index": 110, "name": "company_type_c", "comment": null}, "pi_campaign_c": {"type": "integer", "index": 111, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 112, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 113, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 114, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 115, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "integer", "index": 116, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 117, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 118, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 119, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 120, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 121, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 122, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "integer", "index": 123, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 124, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "integer", "index": 125, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 126, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 127, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "integer", "index": 128, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 129, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 130, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 131, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 132, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 133, "name": "pi_utm_term_c", "comment": null}, "fax": {"type": "integer", "index": 134, "name": "fax", "comment": null}, "region_c": {"type": "integer", "index": 135, "name": "region_c", "comment": null}, "competitor_c": {"type": "boolean", "index": 136, "name": "competitor_c", "comment": null}, "source_detail_c": {"type": "integer", "index": 137, "name": "source_detail_c", "comment": null}, "fivetran_account_stage_c": {"type": "integer", "index": 138, "name": "fivetran_account_stage_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 139, "name": "fivetran_account_id_c", "comment": null}, "lean_data_router_status_c": {"type": "integer", "index": 140, "name": "lean_data_router_status_c", "comment": null}, "lean_data_matched_lead_c": {"type": "integer", "index": 141, "name": "lean_data_matched_lead_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 142, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_search_index_c": {"type": "text", "index": 143, "name": "lean_data_search_index_c", "comment": null}, "lean_data_reporting_matched_account_c": {"type": "text", "index": 144, "name": "lean_data_reporting_matched_account_c", "comment": null}, "lean_data_reporting_timestamp_c": {"type": "timestamp without time zone", "index": 145, "name": "lean_data_reporting_timestamp_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 146, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_marketing_sys_created_date_c": {"type": "integer", "index": 147, "name": "lean_data_marketing_sys_created_date_c", "comment": null}, "lean_data_matched_account_c": {"type": "integer", "index": 148, "name": "lean_data_matched_account_c", "comment": null}, "lean_data_a_2_b_account_c": {"type": "integer", "index": 149, "name": "lean_data_a_2_b_account_c", "comment": null}, "lean_data_search_c": {"type": "integer", "index": 150, "name": "lean_data_search_c", "comment": null}, "lean_data_routing_status_c": {"type": "text", "index": 151, "name": "lean_data_routing_status_c", "comment": null}, "lean_data_a_2_b_group_c": {"type": "integer", "index": 152, "name": "lean_data_a_2_b_group_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 153, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 154, "name": "lean_data_tag_c", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 155, "name": "lean_data_status_info_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 156, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 157, "name": "do_not_route_lead_c", "comment": null}, "partner_type_c": {"type": "integer", "index": 158, "name": "partner_type_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 159, "name": "allbound_id_c", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 160, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 161, "name": "lid_linked_in_member_token_c", "comment": null}, "lean_data_re_route_c": {"type": "integer", "index": 162, "name": "lean_data_re_route_c", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 163, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 164, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 165, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "network_c": {"type": "integer", "index": 166, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 167, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 168, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 169, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 170, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 171, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 172, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 173, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 174, "name": "partner_rep_name_c", "comment": null}, "lead_type_c": {"type": "integer", "index": 175, "name": "lead_type_c", "comment": null}, "contact_stage_c": {"type": "text", "index": 176, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 177, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 178, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 179, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 180, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 181, "name": "original_utm_term_c", "comment": null}, "es_app_esalexa_rank_c": {"type": "integer", "index": 182, "name": "es_app_esalexa_rank_c", "comment": null}, "es_app_esaudience_names_c": {"type": "integer", "index": 183, "name": "es_app_esaudience_names_c", "comment": null}, "es_app_escity_c": {"type": "integer", "index": 184, "name": "es_app_escity_c", "comment": null}, "es_app_escompany_phone_c": {"type": "integer", "index": 185, "name": "es_app_escompany_phone_c", "comment": null}, "es_app_escountry_c": {"type": "integer", "index": 186, "name": "es_app_escountry_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 187, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 188, "name": "es_app_esecid_c", "comment": null}, "es_app_esemployees_c": {"type": "integer", "index": 189, "name": "es_app_esemployees_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 190, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 191, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esfacebook_c": {"type": "integer", "index": 192, "name": "es_app_esfacebook_c", "comment": null}, "es_app_esindustry_c": {"type": "integer", "index": 193, "name": "es_app_esindustry_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 194, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 195, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 196, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_eskeywords_c": {"type": "integer", "index": 197, "name": "es_app_eskeywords_c", "comment": null}, "es_app_eslinked_in_c": {"type": "integer", "index": 198, "name": "es_app_eslinked_in_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 199, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_esrevenue_c": {"type": "integer", "index": 200, "name": "es_app_esrevenue_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 201, "name": "es_app_essource_c", "comment": null}, "es_app_esstate_c": {"type": "integer", "index": 202, "name": "es_app_esstate_c", "comment": null}, "es_app_esstreet_c": {"type": "integer", "index": 203, "name": "es_app_esstreet_c", "comment": null}, "es_app_estechnologies_c": {"type": "integer", "index": 204, "name": "es_app_estechnologies_c", "comment": null}, "es_app_estwitter_c": {"type": "integer", "index": 205, "name": "es_app_estwitter_c", "comment": null}, "es_app_eszipcode_c": {"type": "integer", "index": 206, "name": "es_app_eszipcode_c", "comment": null}, "marketing_prospect_routing_rules_c": {"type": "boolean", "index": 207, "name": "marketing_prospect_routing_rules_c", "comment": null}, "individual_id": {"type": "integer", "index": 208, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 209, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 210, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 211, "name": "user_gems_has_changed_job_c", "comment": null}, "user_gems_linked_in_c": {"type": "integer", "index": 212, "name": "user_gems_linked_in_c", "comment": null}, "email_opt_in_c": {"type": "integer", "index": 213, "name": "email_opt_in_c", "comment": null}, "email_opt_in_explicit_c": {"type": "boolean", "index": 214, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "boolean", "index": 215, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "boolean", "index": 216, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "boolean", "index": 217, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 218, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 219, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 220, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 221, "name": "user_gems_past_title_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 222, "name": "promotion_id_c", "comment": null}, "previous_customer_c": {"type": "integer", "index": 223, "name": "previous_customer_c", "comment": null}, "referral_contact_email_c": {"type": "integer", "index": 224, "name": "referral_contact_email_c", "comment": null}, "referral_firstname_c": {"type": "integer", "index": 225, "name": "referral_firstname_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 226, "name": "referral_last_name_c", "comment": null}, "mkto_71_lead_score_c": {"type": "integer", "index": 227, "name": "mkto_71_lead_score_c", "comment": null}, "mkto_71_acquisition_date_c": {"type": "integer", "index": 228, "name": "mkto_71_acquisition_date_c", "comment": null}, "mkto_71_acquisition_program_id_c": {"type": "integer", "index": 229, "name": "mkto_71_acquisition_program_id_c", "comment": null}, "mkto_acquisition_program_c": {"type": "integer", "index": 230, "name": "mkto_acquisition_program_c", "comment": null}, "mkto_71_inferred_city_c": {"type": "integer", "index": 231, "name": "mkto_71_inferred_city_c", "comment": null}, "mkto_71_inferred_company_c": {"type": "integer", "index": 232, "name": "mkto_71_inferred_company_c", "comment": null}, "mkto_71_inferred_country_c": {"type": "integer", "index": 233, "name": "mkto_71_inferred_country_c", "comment": null}, "mkto_71_inferred_metropolitan_area_c": {"type": "integer", "index": 234, "name": "mkto_71_inferred_metropolitan_area_c", "comment": null}, "mkto_71_inferred_phone_area_code_c": {"type": "integer", "index": 235, "name": "mkto_71_inferred_phone_area_code_c", "comment": null}, "mkto_71_inferred_postal_code_c": {"type": "integer", "index": 236, "name": "mkto_71_inferred_postal_code_c", "comment": null}, "mkto_71_inferred_state_region_c": {"type": "integer", "index": 237, "name": "mkto_71_inferred_state_region_c", "comment": null}, "mkto_71_original_referrer_c": {"type": "integer", "index": 238, "name": "mkto_71_original_referrer_c", "comment": null}, "mkto_71_original_search_engine_c": {"type": "integer", "index": 239, "name": "mkto_71_original_search_engine_c", "comment": null}, "mkto_71_original_search_phrase_c": {"type": "integer", "index": 240, "name": "mkto_71_original_search_phrase_c", "comment": null}, "mkto_71_original_source_info_c": {"type": "integer", "index": 241, "name": "mkto_71_original_source_info_c", "comment": null}, "mkto_71_original_source_type_c": {"type": "integer", "index": 242, "name": "mkto_71_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 243, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "timestamp without time zone", "index": 244, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "text", "index": 245, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "text", "index": 246, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "text", "index": 247, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_msicontact_id_c": {"type": "integer", "index": 248, "name": "mkto_si_msicontact_id_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 249, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 250, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 251, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ar_c": {"type": "integer", "index": 252, "name": "cloudingo_agent_ar_c", "comment": null}, "cloudingo_agent_ardi_c": {"type": "integer", "index": 253, "name": "cloudingo_agent_ardi_c", "comment": null}, "cloudingo_agent_as_c": {"type": "integer", "index": 254, "name": "cloudingo_agent_as_c", "comment": null}, "cloudingo_agent_atz_c": {"type": "integer", "index": 255, "name": "cloudingo_agent_atz_c", "comment": null}, "cloudingo_agent_av_c": {"type": "integer", "index": 256, "name": "cloudingo_agent_av_c", "comment": null}, "cloudingo_agent_les_c": {"type": "integer", "index": 257, "name": "cloudingo_agent_les_c", "comment": null}, "do_not_sync_marketo_c": {"type": "boolean", "index": 258, "name": "do_not_sync_marketo_c", "comment": null}, "source_every_utm_campaign_c": {"type": "integer", "index": 259, "name": "source_every_utm_campaign_c", "comment": null}, "source_every_utm_content_c": {"type": "integer", "index": 260, "name": "source_every_utm_content_c", "comment": null}, "source_every_utm_medium_c": {"type": "integer", "index": 261, "name": "source_every_utm_medium_c", "comment": null}, "source_every_utm_source_c": {"type": "integer", "index": 262, "name": "source_every_utm_source_c", "comment": null}, "source_every_utm_term_c": {"type": "integer", "index": 263, "name": "source_every_utm_term_c", "comment": null}, "source_first_utm_campaign_c": {"type": "integer", "index": 264, "name": "source_first_utm_campaign_c", "comment": null}, "source_first_utm_content_c": {"type": "integer", "index": 265, "name": "source_first_utm_content_c", "comment": null}, "source_first_utm_medium_c": {"type": "integer", "index": 266, "name": "source_first_utm_medium_c", "comment": null}, "source_first_utm_source_c": {"type": "integer", "index": 267, "name": "source_first_utm_source_c", "comment": null}, "source_first_utm_term_c": {"type": "integer", "index": 268, "name": "source_first_utm_term_c", "comment": null}, "source_last_utm_campaign_c": {"type": "text", "index": 269, "name": "source_last_utm_campaign_c", "comment": null}, "source_last_utm_content_c": {"type": "text", "index": 270, "name": "source_last_utm_content_c", "comment": null}, "source_last_utm_medium_c": {"type": "text", "index": 271, "name": "source_last_utm_medium_c", "comment": null}, "source_last_utm_source_c": {"type": "text", "index": 272, "name": "source_last_utm_source_c", "comment": null}, "source_last_utm_term_c": {"type": "text", "index": 273, "name": "source_last_utm_term_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 274, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 275, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 276, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 277, "name": "state_c", "comment": null}, "source_first_lead_source_category_c": {"type": "integer", "index": 278, "name": "source_first_lead_source_category_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 279, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 280, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 281, "name": "source_last_lead_source_detail_c", "comment": null}, "source_every_lead_source_c": {"type": "integer", "index": 282, "name": "source_every_lead_source_c", "comment": null}, "source_every_lead_source_category_c": {"type": "integer", "index": 283, "name": "source_every_lead_source_category_c", "comment": null}, "source_every_lead_source_detail_c": {"type": "integer", "index": 284, "name": "source_every_lead_source_detail_c", "comment": null}, "source_first_lead_source_c": {"type": "integer", "index": 285, "name": "source_first_lead_source_c", "comment": null}, "source_first_lead_source_detail_c": {"type": "integer", "index": 286, "name": "source_first_lead_source_detail_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 287, "name": "behavioral_score_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 288, "name": "demographic_score_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 289, "name": "drift_cql_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 290, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "boolean", "index": 291, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 292, "name": "csi_code_c", "comment": null}, "csi_description_c": {"type": "text", "index": 293, "name": "csi_description_c", "comment": null}, "converted_date_time_c": {"type": "timestamp without time zone", "index": 294, "name": "converted_date_time_c", "comment": null}, "lead_created_date_time_reporting_c": {"type": "timestamp without time zone", "index": 295, "name": "lead_created_date_time_reporting_c", "comment": null}, "lead_iq_country_c": {"type": "integer", "index": 296, "name": "lead_iq_country_c", "comment": null}, "lead_iq_employee_count_c": {"type": "integer", "index": 297, "name": "lead_iq_employee_count_c", "comment": null}, "lead_iq_employee_range_c": {"type": "integer", "index": 298, "name": "lead_iq_employee_range_c", "comment": null}, "lead_iq_state_c": {"type": "integer", "index": 299, "name": "lead_iq_state_c", "comment": null}, "lead_iq_zip_code_c": {"type": "integer", "index": 300, "name": "lead_iq_zip_code_c", "comment": null}, "zoominfo_country_c": {"type": "integer", "index": 301, "name": "zoominfo_country_c", "comment": null}, "zoominfo_employee_count_c": {"type": "integer", "index": 302, "name": "zoominfo_employee_count_c", "comment": null}, "zoominfo_state_c": {"type": "integer", "index": 303, "name": "zoominfo_state_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 304, "name": "zoominfo_technologies_c", "comment": null}, "zoominfo_zip_code_c": {"type": "integer", "index": 305, "name": "zoominfo_zip_code_c", "comment": null}, "attended_event_c": {"type": "boolean", "index": 306, "name": "attended_event_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 307, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 308, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 309, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 310, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 311, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 312, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "boolean", "index": 313, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 314, "name": "first_mql_date_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 315, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 316, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "text", "index": 317, "name": "mql_reason_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 318, "name": "trial_contact_start_date_c", "comment": null}, "enrichment_request_c": {"type": "boolean", "index": 319, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "timestamp without time zone", "index": 320, "name": "meta_data_create_date_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 321, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 322, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 323, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 324, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 325, "name": "clarus_status_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 326, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 327, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 328, "name": "salesloft_cadence_trigger_c", "comment": null}, "datawarehouse_used_c": {"type": "integer", "index": 329, "name": "datawarehouse_used_c", "comment": null}, "contact_status_c": {"type": "integer", "index": 330, "name": "contact_status_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 331, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "text", "index": 332, "name": "potential_fivetran_use_case_c", "comment": null}, "bizible_2_account_c": {"type": "integer", "index": 333, "name": "bizible_2_account_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 334, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 335, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 336, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 337, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 338, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 339, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 340, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 341, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 342, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 343, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 344, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "boolean", "index": 345, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 346, "name": "sales_email_opt_out_date_time_c", "comment": null}, "bombora_app_bombora_surge_record_count_c": {"type": "integer", "index": 347, "name": "bombora_app_bombora_surge_record_count_c", "comment": null}, "bombora_app_bombora_last_date_time_updated_c": {"type": "integer", "index": 348, "name": "bombora_app_bombora_last_date_time_updated_c", "comment": null}, "bombora_app_bombora_total_composite_score_c": {"type": "integer", "index": 349, "name": "bombora_app_bombora_total_composite_score_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 350, "name": "linked_in_url_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 351, "name": "beta_connector_interest_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 352, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 353, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "boolean", "index": 354, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 355, "name": "free_trial_email_confirmed_date_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 356, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "dnboptimizer_dn_bcompany_record_c": {"type": "integer", "index": 357, "name": "dnboptimizer_dn_bcompany_record_c", "comment": null}, "dnboptimizer_dnb_d_u_n_s_number_c": {"type": "integer", "index": 358, "name": "dnboptimizer_dnb_d_u_n_s_number_c", "comment": null}, "i_sell_oskey_id_c": {"type": "integer", "index": 359, "name": "i_sell_oskey_id_c", "comment": null}, "verified_c": {"type": "boolean", "index": 360, "name": "verified_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 361, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_c": {"type": "integer", "index": 362, "name": "pbf_startup_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "boolean", "index": 363, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 364, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 365, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 366, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_matched_account_c": {"type": "integer", "index": 367, "name": "engagio_matched_account_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 368, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_match_time_c": {"type": "integer", "index": 369, "name": "engagio_match_time_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 370, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 371, "name": "engagio_role_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 372, "name": "legacy_hvr_id_c", "comment": null}, "hvr_channel_c": {"type": "integer", "index": 373, "name": "hvr_channel_c", "comment": null}, "email_opt_in_double_c": {"type": "boolean", "index": 374, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 375, "name": "phone_number_catch_all_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 376, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 377, "name": "utm_id_c", "comment": null}, "source_every_utm_id_c": {"type": "integer", "index": 378, "name": "source_every_utm_id_c", "comment": null}, "source_last_utm_id_c": {"type": "integer", "index": 379, "name": "source_last_utm_id_c", "comment": null}, "source_first_utm_id_c": {"type": "integer", "index": 380, "name": "source_first_utm_id_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 381, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 382, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_lead_data"}, "seed.salesforce_integration_tests.sf_opportunity_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 7, "name": "description", "comment": null}, "expected_revenue": {"type": "integer", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_excluded_from_territory_2_filter": {"type": "integer", "index": 20, "name": "is_excluded_from_territory_2_filter", "comment": null}, "is_won": {"type": "boolean", "index": 21, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 22, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 25, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 27, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 29, "name": "pricebook_2_id", "comment": null}, "probability": {"type": "double precision", "index": 30, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 32, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 33, "name": "synced_quote_id", "comment": null}, "territory_2_id": {"type": "integer", "index": 34, "name": "territory_2_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 36, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_opportunity_data"}, "seed.salesforce_integration_tests.sf_opportunity_history_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 5, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 6, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 7, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 8, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 9, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 10, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 11, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 12, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 13, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 14, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 15, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 16, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 17, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 18, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 19, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 21, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 22, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 23, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 24, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 25, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 26, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 27, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 29, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 30, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 31, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 32, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 33, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 34, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}}, "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.salesforce_integration_tests.sf_opportunity_history_data"}, "seed.salesforce_integration_tests.sf_opportunity_line_item_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"product_2_id": {"type": "text", "index": 1, "name": "product_2_id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "total_price": {"type": "double precision", "index": 3, "name": "total_price", "comment": null}, "description": {"type": "integer", "index": 4, "name": "description", "comment": null}, "discount": {"type": "integer", "index": 5, "name": "discount", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 6, "name": "last_modified_date", "comment": null}, "list_price": {"type": "integer", "index": 7, "name": "list_price", "comment": null}, "product_code": {"type": "text", "index": 8, "name": "product_code", "comment": null}, "unit_price": {"type": "double precision", "index": 9, "name": "unit_price", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "opportunity_id": {"type": "text", "index": 12, "name": "opportunity_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 14, "name": "service_date", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 15, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 16, "name": "name", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "sort_order": {"type": "integer", "index": 20, "name": "sort_order", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 21, "name": "pricebook_entry_id", "comment": null}, "one_saas_app_included_c": {"type": "integer", "index": 22, "name": "one_saas_app_included_c", "comment": null}, "one_saas_app_quantity_invoiced_c": {"type": "integer", "index": 23, "name": "one_saas_app_quantity_invoiced_c", "comment": null}, "one_saas_app_quantity_not_invoiced_c": {"type": "integer", "index": 24, "name": "one_saas_app_quantity_not_invoiced_c", "comment": null}, "has_quantity_schedule": {"type": "integer", "index": 25, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "integer", "index": 26, "name": "has_revenue_schedule", "comment": null}, "has_schedule": {"type": "integer", "index": 27, "name": "has_schedule", "comment": null}, "event_volume_c": {"type": "integer", "index": 28, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 29, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 30, "name": "row_volume_c", "comment": null}, "months_c": {"type": "integer", "index": 31, "name": "months_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 32, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_discount_item_c": {"type": "integer", "index": 33, "name": "netsuite_conn_discount_item_c", "comment": null}, "netsuite_conn_user_entered_sales_price_c": {"type": "integer", "index": 34, "name": "netsuite_conn_user_entered_sales_price_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 35, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_terms_c": {"type": "integer", "index": 36, "name": "netsuite_conn_terms_c", "comment": null}, "netsuite_conn_net_suite_item_key_id_c": {"type": "integer", "index": 37, "name": "netsuite_conn_net_suite_item_key_id_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 38, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_end_date_c": {"type": "integer", "index": 39, "name": "netsuite_conn_end_date_c", "comment": null}, "netsuite_conn_list_rate_c": {"type": "integer", "index": 40, "name": "netsuite_conn_list_rate_c", "comment": null}, "netsuite_conn_from_contract_item_id_c": {"type": "integer", "index": 41, "name": "netsuite_conn_from_contract_item_id_c", "comment": null}, "netsuite_conn_start_date_c": {"type": "integer", "index": 42, "name": "netsuite_conn_start_date_c", "comment": null}, "netsuite_conn_net_suite_item_id_import_c": {"type": "integer", "index": 43, "name": "netsuite_conn_net_suite_item_id_import_c", "comment": null}, "sbqq_parent_id_c": {"type": "text", "index": 44, "name": "sbqq_parent_id_c", "comment": null}, "sbqq_quote_line_c": {"type": "text", "index": 45, "name": "sbqq_quote_line_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 46, "name": "sbqq_subscription_type_c", "comment": null}, "product_family_c": {"type": "text", "index": 47, "name": "product_family_c", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 48, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 49, "name": "last_viewed_date", "comment": null}, "celigo_sfnsio_contract_item_id_c": {"type": "integer", "index": 50, "name": "celigo_sfnsio_contract_item_id_c", "comment": null}, "celigo_sfnsio_contract_term_c": {"type": "integer", "index": 51, "name": "celigo_sfnsio_contract_term_c", "comment": null}, "celigo_sfnsio_end_date_c": {"type": "integer", "index": 52, "name": "celigo_sfnsio_end_date_c", "comment": null}, "celigo_sfnsio_list_rate_c": {"type": "integer", "index": 53, "name": "celigo_sfnsio_list_rate_c", "comment": null}, "celigo_sfnsio_net_suite_line_id_c": {"type": "integer", "index": 54, "name": "celigo_sfnsio_net_suite_line_id_c", "comment": null}, "celigo_sfnsio_start_date_c": {"type": "integer", "index": 55, "name": "celigo_sfnsio_start_date_c", "comment": null}, "product_code_stamped_c": {"type": "integer", "index": 56, "name": "product_code_stamped_c", "comment": null}, "hvr_use_case_c": {"type": "boolean", "index": 57, "name": "hvr_use_case_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 58, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_opportunity_line_item_data"}, "seed.salesforce_integration_tests.sf_order_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": null}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": null}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "integer", "index": 8, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 9, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "integer", "index": 10, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "integer", "index": 11, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 12, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 13, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "integer", "index": 14, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": null}, "company_authorized_by_id": {"type": "integer", "index": 16, "name": "company_authorized_by_id", "comment": null}, "contract_id": {"type": "integer", "index": 17, "name": "contract_id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "customer_authorized_by_id": {"type": "integer", "index": 20, "name": "customer_authorized_by_id", "comment": null}, "description": {"type": "integer", "index": 21, "name": "description", "comment": null}, "effective_date": {"type": "timestamp without time zone", "index": 22, "name": "effective_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 23, "name": "end_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": null}, "is_reduction_order": {"type": "boolean", "index": 25, "name": "is_reduction_order", "comment": null}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 28, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 29, "name": "last_viewed_date", "comment": null}, "order_number": {"type": "integer", "index": 30, "name": "order_number", "comment": null}, "original_order_id": {"type": "integer", "index": 31, "name": "original_order_id", "comment": null}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 33, "name": "pricebook_2_id", "comment": null}, "shipping_city": {"type": "text", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "integer", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "integer", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "integer", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 43, "name": "shipping_street", "comment": null}, "status": {"type": "text", "index": 44, "name": "status", "comment": null}, "status_code": {"type": "text", "index": 45, "name": "status_code", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 46, "name": "system_modstamp", "comment": null}, "total_amount": {"type": "double precision", "index": 47, "name": "total_amount", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 49, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_opportunity_c": {"type": "integer", "index": 53, "name": "netsuite_conn_opportunity_c", "comment": null}, "netsuite_conn_net_suite_order_status_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_order_status_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 55, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_tax_total_c": {"type": "integer", "index": 56, "name": "netsuite_conn_tax_total_c", "comment": null}, "netsuite_conn_tracking_numbers_c": {"type": "integer", "index": 57, "name": "netsuite_conn_tracking_numbers_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 58, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_document_id_c": {"type": "integer", "index": 59, "name": "netsuite_conn_document_id_c", "comment": null}, "netsuite_conn_subtotal_c": {"type": "integer", "index": 60, "name": "netsuite_conn_subtotal_c", "comment": null}, "netsuite_conn_discount_total_c": {"type": "integer", "index": 61, "name": "netsuite_conn_discount_total_c", "comment": null}, "netsuite_conn_total_c": {"type": "integer", "index": 62, "name": "netsuite_conn_total_c", "comment": null}, "netsuite_conn_net_suite_order_date_c": {"type": "timestamp without time zone", "index": 63, "name": "netsuite_conn_net_suite_order_date_c", "comment": null}, "netsuite_conn_ship_date_c": {"type": "integer", "index": 64, "name": "netsuite_conn_ship_date_c", "comment": null}, "netsuite_conn_quote_c": {"type": "integer", "index": 65, "name": "netsuite_conn_quote_c", "comment": null}, "netsuite_conn_net_suite_order_number_c": {"type": "text", "index": 66, "name": "netsuite_conn_net_suite_order_number_c", "comment": null}, "sbqq_contracted_c": {"type": "boolean", "index": 67, "name": "sbqq_contracted_c", "comment": null}, "sbqq_contracting_method_c": {"type": "text", "index": 68, "name": "sbqq_contracting_method_c", "comment": null}, "sbqq_payment_term_c": {"type": "text", "index": 69, "name": "sbqq_payment_term_c", "comment": null}, "sbqq_price_calc_status_c": {"type": "text", "index": 70, "name": "sbqq_price_calc_status_c", "comment": null}, "sbqq_price_calc_status_message_c": {"type": "integer", "index": 71, "name": "sbqq_price_calc_status_message_c", "comment": null}, "sbqq_quote_c": {"type": "text", "index": 72, "name": "sbqq_quote_c", "comment": null}, "sbqq_renewal_term_c": {"type": "integer", "index": 73, "name": "sbqq_renewal_term_c", "comment": null}, "sbqq_renewal_uplift_rate_c": {"type": "integer", "index": 74, "name": "sbqq_renewal_uplift_rate_c", "comment": null}, "ava_sfcpq_ava_tax_message_c": {"type": "text", "index": 75, "name": "ava_sfcpq_ava_tax_message_c", "comment": null}, "ava_sfcpq_entity_use_code_c": {"type": "integer", "index": 76, "name": "ava_sfcpq_entity_use_code_c", "comment": null}, "ava_sfcpq_invoice_message_c": {"type": "integer", "index": 77, "name": "ava_sfcpq_invoice_message_c", "comment": null}, "ava_sfcpq_is_seller_importer_of_record_c": {"type": "boolean", "index": 78, "name": "ava_sfcpq_is_seller_importer_of_record_c", "comment": null}, "ava_sfcpq_order_calculate_tax_c": {"type": "boolean", "index": 79, "name": "ava_sfcpq_order_calculate_tax_c", "comment": null}, "ava_sfcpq_sales_tax_amount_c": {"type": "integer", "index": 80, "name": "ava_sfcpq_sales_tax_amount_c", "comment": null}, "blng_bill_now_c": {"type": "boolean", "index": 81, "name": "blng_bill_now_c", "comment": null}, "blng_billing_account_c": {"type": "text", "index": 82, "name": "blng_billing_account_c", "comment": null}, "blng_billing_day_of_month_c": {"type": "integer", "index": 83, "name": "blng_billing_day_of_month_c", "comment": null}, "blng_invoice_batch_c": {"type": "text", "index": 84, "name": "blng_invoice_batch_c", "comment": null}, "amendment_type_c": {"type": "integer", "index": 85, "name": "amendment_type_c", "comment": null}, "credit_summary_c": {"type": "text", "index": 86, "name": "credit_summary_c", "comment": null}, "evergreen_c": {"type": "boolean", "index": 87, "name": "evergreen_c", "comment": null}, "invoicing_type_c": {"type": "text", "index": 88, "name": "invoicing_type_c", "comment": null}, "legal_entity_c": {"type": "text", "index": 89, "name": "legal_entity_c", "comment": null}, "prepaid_billing_frequency_c": {"type": "text", "index": 90, "name": "prepaid_billing_frequency_c", "comment": null}, "prepaid_order_c": {"type": "boolean", "index": 91, "name": "prepaid_order_c", "comment": null}, "update_subscriptions_only_c": {"type": "boolean", "index": 92, "name": "update_subscriptions_only_c", "comment": null}, "order_auto_activated_c": {"type": "boolean", "index": 93, "name": "order_auto_activated_c", "comment": null}, "synced_to_net_suite_c": {"type": "boolean", "index": 94, "name": "synced_to_net_suite_c", "comment": null}, "purchase_order_number_c": {"type": "integer", "index": 95, "name": "purchase_order_number_c", "comment": null}, "celigo_sfnsio_discount_total_net_suite_c": {"type": "integer", "index": 96, "name": "celigo_sfnsio_discount_total_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 97, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_order_number_c": {"type": "text", "index": 98, "name": "celigo_sfnsio_net_suite_order_number_c", "comment": null}, "celigo_sfnsio_net_suite_order_status_c": {"type": "integer", "index": 99, "name": "celigo_sfnsio_net_suite_order_status_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "text", "index": 100, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_ship_date_c": {"type": "integer", "index": 101, "name": "celigo_sfnsio_ship_date_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 102, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_sub_total_net_suite_c": {"type": "integer", "index": 103, "name": "celigo_sfnsio_sub_total_net_suite_c", "comment": null}, "celigo_sfnsio_tax_total_net_suite_c": {"type": "integer", "index": 104, "name": "celigo_sfnsio_tax_total_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 105, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_total_net_suite_c": {"type": "integer", "index": 106, "name": "celigo_sfnsio_total_net_suite_c", "comment": null}, "amend_with_rollover_spend_type_c": {"type": "boolean", "index": 107, "name": "amend_with_rollover_spend_type_c", "comment": null}, "customer_spend_type_c": {"type": "integer", "index": 108, "name": "customer_spend_type_c", "comment": null}, "order_spend_type_c": {"type": "integer", "index": 109, "name": "order_spend_type_c", "comment": null}, "opportunity_id": {"type": "integer", "index": 110, "name": "opportunity_id", "comment": null}, "purchase_summary_c": {"type": "integer", "index": 111, "name": "purchase_summary_c", "comment": null}, "is_hvr_legacy_order_c": {"type": "integer", "index": 112, "name": "is_hvr_legacy_order_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 113, "name": "ironclad_workflow_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 114, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_order_data"}, "seed.salesforce_integration_tests.sf_product_2_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"last_referenced_date": {"type": "timestamp without time zone", "index": 1, "name": "last_referenced_date", "comment": null}, "is_active": {"type": "boolean", "index": 2, "name": "is_active", "comment": null}, "description": {"type": "integer", "index": 3, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 4, "name": "last_modified_date", "comment": null}, "record_type_id": {"type": "text", "index": 5, "name": "record_type_id", "comment": null}, "product_code": {"type": "integer", "index": 6, "name": "product_code", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 8, "name": "last_viewed_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 12, "name": "name", "comment": null}, "id": {"type": "text", "index": 13, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": null}, "family": {"type": "text", "index": 16, "name": "family", "comment": null}, "max_volume_c": {"type": "integer", "index": 17, "name": "max_volume_c", "comment": null}, "min_volume_c": {"type": "integer", "index": 18, "name": "min_volume_c", "comment": null}, "request_name_c": {"type": "integer", "index": 19, "name": "request_name_c", "comment": null}, "default_quantity_c": {"type": "integer", "index": 20, "name": "default_quantity_c", "comment": null}, "account_c": {"type": "integer", "index": 21, "name": "account_c", "comment": null}, "related_product_c": {"type": "integer", "index": 22, "name": "related_product_c", "comment": null}, "picklist_value_c": {"type": "integer", "index": 23, "name": "picklist_value_c", "comment": null}, "as_input_c": {"type": "integer", "index": 24, "name": "as_input_c", "comment": null}, "as_output_c": {"type": "integer", "index": 25, "name": "as_output_c", "comment": null}, "status_c": {"type": "integer", "index": 26, "name": "status_c", "comment": null}, "number_of_quantity_installments": {"type": "integer", "index": 27, "name": "number_of_quantity_installments", "comment": null}, "number_of_revenue_installments": {"type": "integer", "index": 28, "name": "number_of_revenue_installments", "comment": null}, "quantity_installment_period": {"type": "integer", "index": 29, "name": "quantity_installment_period", "comment": null}, "quantity_schedule_type": {"type": "integer", "index": 30, "name": "quantity_schedule_type", "comment": null}, "revenue_installment_period": {"type": "integer", "index": 31, "name": "revenue_installment_period", "comment": null}, "revenue_schedule_type": {"type": "integer", "index": 32, "name": "revenue_schedule_type", "comment": null}, "connections_c": {"type": "integer", "index": 33, "name": "connections_c", "comment": null}, "event_volume_c": {"type": "integer", "index": 34, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 35, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 36, "name": "row_volume_c", "comment": null}, "display_url": {"type": "integer", "index": 37, "name": "display_url", "comment": null}, "external_data_source_id": {"type": "integer", "index": 38, "name": "external_data_source_id", "comment": null}, "external_id": {"type": "integer", "index": 39, "name": "external_id", "comment": null}, "quantity_unit_of_measure": {"type": "integer", "index": 40, "name": "quantity_unit_of_measure", "comment": null}, "stock_keeping_unit": {"type": "integer", "index": 41, "name": "stock_keeping_unit", "comment": null}, "features_c": {"type": "integer", "index": 42, "name": "features_c", "comment": null}, "tier_3_price_c": {"type": "integer", "index": 43, "name": "tier_3_price_c", "comment": null}, "tier_2_price_c": {"type": "integer", "index": 44, "name": "tier_2_price_c", "comment": null}, "tier_4_price_c": {"type": "integer", "index": 45, "name": "tier_4_price_c", "comment": null}, "tier_1_price_c": {"type": "integer", "index": 46, "name": "tier_1_price_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 47, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 48, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 49, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "text", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 53, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_net_suite_item_type_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_item_type_c", "comment": null}, "netsuite_conn_sub_type_c": {"type": "text", "index": 55, "name": "netsuite_conn_sub_type_c", "comment": null}, "is_new_c": {"type": "boolean", "index": 56, "name": "is_new_c", "comment": null}, "product_metadata_c": {"type": "integer", "index": 57, "name": "product_metadata_c", "comment": null}, "product_metadata_del_c": {"type": "integer", "index": 58, "name": "product_metadata_del_c", "comment": null}, "sbqq_asset_amendment_behavior_c": {"type": "text", "index": 59, "name": "sbqq_asset_amendment_behavior_c", "comment": null}, "sbqq_asset_conversion_c": {"type": "text", "index": 60, "name": "sbqq_asset_conversion_c", "comment": null}, "sbqq_batch_quantity_c": {"type": "integer", "index": 61, "name": "sbqq_batch_quantity_c", "comment": null}, "sbqq_billing_frequency_c": {"type": "text", "index": 62, "name": "sbqq_billing_frequency_c", "comment": null}, "sbqq_billing_type_c": {"type": "text", "index": 63, "name": "sbqq_billing_type_c", "comment": null}, "sbqq_block_pricing_field_c": {"type": "text", "index": 64, "name": "sbqq_block_pricing_field_c", "comment": null}, "sbqq_charge_type_c": {"type": "text", "index": 65, "name": "sbqq_charge_type_c", "comment": null}, "sbqq_component_c": {"type": "boolean", "index": 66, "name": "sbqq_component_c", "comment": null}, "sbqq_compound_discount_rate_c": {"type": "integer", "index": 67, "name": "sbqq_compound_discount_rate_c", "comment": null}, "sbqq_configuration_event_c": {"type": "integer", "index": 68, "name": "sbqq_configuration_event_c", "comment": null}, "sbqq_configuration_field_set_c": {"type": "integer", "index": 69, "name": "sbqq_configuration_field_set_c", "comment": null}, "sbqq_configuration_fields_c": {"type": "integer", "index": 70, "name": "sbqq_configuration_fields_c", "comment": null}, "sbqq_configuration_form_title_c": {"type": "integer", "index": 71, "name": "sbqq_configuration_form_title_c", "comment": null}, "sbqq_configuration_type_c": {"type": "integer", "index": 72, "name": "sbqq_configuration_type_c", "comment": null}, "sbqq_configuration_validator_c": {"type": "integer", "index": 73, "name": "sbqq_configuration_validator_c", "comment": null}, "sbqq_configured_code_pattern_c": {"type": "integer", "index": 74, "name": "sbqq_configured_code_pattern_c", "comment": null}, "sbqq_configured_description_pattern_c": {"type": "integer", "index": 75, "name": "sbqq_configured_description_pattern_c", "comment": null}, "sbqq_cost_editable_c": {"type": "boolean", "index": 76, "name": "sbqq_cost_editable_c", "comment": null}, "sbqq_cost_schedule_c": {"type": "integer", "index": 77, "name": "sbqq_cost_schedule_c", "comment": null}, "sbqq_custom_configuration_page_c": {"type": "integer", "index": 78, "name": "sbqq_custom_configuration_page_c", "comment": null}, "sbqq_custom_configuration_required_c": {"type": "boolean", "index": 79, "name": "sbqq_custom_configuration_required_c", "comment": null}, "sbqq_customer_community_availability_c": {"type": "integer", "index": 80, "name": "sbqq_customer_community_availability_c", "comment": null}, "sbqq_default_pricing_table_c": {"type": "integer", "index": 81, "name": "sbqq_default_pricing_table_c", "comment": null}, "sbqq_default_quantity_c": {"type": "integer", "index": 82, "name": "sbqq_default_quantity_c", "comment": null}, "sbqq_description_locked_c": {"type": "boolean", "index": 83, "name": "sbqq_description_locked_c", "comment": null}, "sbqq_discount_category_c": {"type": "integer", "index": 84, "name": "sbqq_discount_category_c", "comment": null}, "sbqq_discount_schedule_c": {"type": "integer", "index": 85, "name": "sbqq_discount_schedule_c", "comment": null}, "sbqq_dynamic_pricing_constraint_c": {"type": "integer", "index": 86, "name": "sbqq_dynamic_pricing_constraint_c", "comment": null}, "sbqq_exclude_from_maintenance_c": {"type": "boolean", "index": 87, "name": "sbqq_exclude_from_maintenance_c", "comment": null}, "sbqq_exclude_from_opportunity_c": {"type": "boolean", "index": 88, "name": "sbqq_exclude_from_opportunity_c", "comment": null}, "sbqq_externally_configurable_c": {"type": "boolean", "index": 89, "name": "sbqq_externally_configurable_c", "comment": null}, "sbqq_generate_contracted_price_c": {"type": "integer", "index": 90, "name": "sbqq_generate_contracted_price_c", "comment": null}, "sbqq_has_configuration_attributes_c": {"type": "boolean", "index": 91, "name": "sbqq_has_configuration_attributes_c", "comment": null}, "sbqq_has_consumption_schedule_c": {"type": "boolean", "index": 92, "name": "sbqq_has_consumption_schedule_c", "comment": null}, "sbqq_hidden_c": {"type": "boolean", "index": 93, "name": "sbqq_hidden_c", "comment": null}, "sbqq_hide_price_in_search_results_c": {"type": "boolean", "index": 94, "name": "sbqq_hide_price_in_search_results_c", "comment": null}, "sbqq_include_in_maintenance_c": {"type": "boolean", "index": 95, "name": "sbqq_include_in_maintenance_c", "comment": null}, "sbqq_new_quote_group_c": {"type": "boolean", "index": 96, "name": "sbqq_new_quote_group_c", "comment": null}, "sbqq_non_discountable_c": {"type": "boolean", "index": 97, "name": "sbqq_non_discountable_c", "comment": null}, "sbqq_non_partner_discountable_c": {"type": "boolean", "index": 98, "name": "sbqq_non_partner_discountable_c", "comment": null}, "sbqq_option_layout_c": {"type": "integer", "index": 99, "name": "sbqq_option_layout_c", "comment": null}, "sbqq_option_selection_method_c": {"type": "text", "index": 100, "name": "sbqq_option_selection_method_c", "comment": null}, "sbqq_optional_c": {"type": "boolean", "index": 101, "name": "sbqq_optional_c", "comment": null}, "sbqq_price_editable_c": {"type": "boolean", "index": 102, "name": "sbqq_price_editable_c", "comment": null}, "sbqq_pricing_method_c": {"type": "text", "index": 103, "name": "sbqq_pricing_method_c", "comment": null}, "sbqq_pricing_method_editable_c": {"type": "boolean", "index": 104, "name": "sbqq_pricing_method_editable_c", "comment": null}, "sbqq_product_picture_id_c": {"type": "integer", "index": 105, "name": "sbqq_product_picture_id_c", "comment": null}, "sbqq_quantity_editable_c": {"type": "boolean", "index": 106, "name": "sbqq_quantity_editable_c", "comment": null}, "sbqq_quantity_scale_c": {"type": "integer", "index": 107, "name": "sbqq_quantity_scale_c", "comment": null}, "sbqq_reconfiguration_disabled_c": {"type": "boolean", "index": 108, "name": "sbqq_reconfiguration_disabled_c", "comment": null}, "sbqq_renewal_product_c": {"type": "integer", "index": 109, "name": "sbqq_renewal_product_c", "comment": null}, "sbqq_sort_order_c": {"type": "integer", "index": 110, "name": "sbqq_sort_order_c", "comment": null}, "sbqq_specifications_c": {"type": "integer", "index": 111, "name": "sbqq_specifications_c", "comment": null}, "sbqq_subscription_base_c": {"type": "text", "index": 112, "name": "sbqq_subscription_base_c", "comment": null}, "sbqq_subscription_category_c": {"type": "integer", "index": 113, "name": "sbqq_subscription_category_c", "comment": null}, "sbqq_subscription_percent_c": {"type": "integer", "index": 114, "name": "sbqq_subscription_percent_c", "comment": null}, "sbqq_subscription_pricing_c": {"type": "text", "index": 115, "name": "sbqq_subscription_pricing_c", "comment": null}, "sbqq_subscription_target_c": {"type": "integer", "index": 116, "name": "sbqq_subscription_target_c", "comment": null}, "sbqq_subscription_term_c": {"type": "integer", "index": 117, "name": "sbqq_subscription_term_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 118, "name": "sbqq_subscription_type_c", "comment": null}, "sbqq_tax_code_c": {"type": "integer", "index": 119, "name": "sbqq_tax_code_c", "comment": null}, "sbqq_taxable_c": {"type": "boolean", "index": 120, "name": "sbqq_taxable_c", "comment": null}, "sbqq_term_discount_level_c": {"type": "integer", "index": 121, "name": "sbqq_term_discount_level_c", "comment": null}, "sbqq_term_discount_schedule_c": {"type": "integer", "index": 122, "name": "sbqq_term_discount_schedule_c", "comment": null}, "sbqq_upgrade_credit_c": {"type": "integer", "index": 123, "name": "sbqq_upgrade_credit_c", "comment": null}, "sbqq_upgrade_ratio_c": {"type": "integer", "index": 124, "name": "sbqq_upgrade_ratio_c", "comment": null}, "sbqq_upgrade_source_c": {"type": "integer", "index": 125, "name": "sbqq_upgrade_source_c", "comment": null}, "sbqq_upgrade_target_c": {"type": "integer", "index": 126, "name": "sbqq_upgrade_target_c", "comment": null}, "connector_type_c": {"type": "text", "index": 127, "name": "connector_type_c", "comment": null}, "pbf_pro_type_discount_c": {"type": "boolean", "index": 128, "name": "pbf_pro_type_discount_c", "comment": null}, "dimension_c": {"type": "text", "index": 129, "name": "dimension_c", "comment": null}, "connector_status_c": {"type": "text", "index": 130, "name": "connector_status_c", "comment": null}, "dimension_definition_c": {"type": "integer", "index": 131, "name": "dimension_definition_c", "comment": null}, "ava_sfcpq_tax_code_c": {"type": "integer", "index": 132, "name": "ava_sfcpq_tax_code_c", "comment": null}, "paid_consumption_c": {"type": "integer", "index": 133, "name": "paid_consumption_c", "comment": null}, "is_complimentary_c": {"type": "boolean", "index": 134, "name": "is_complimentary_c", "comment": null}, "product_external_id_c": {"type": "integer", "index": 135, "name": "product_external_id_c", "comment": null}, "blng_billing_rule_c": {"type": "text", "index": 136, "name": "blng_billing_rule_c", "comment": null}, "blng_revenue_recognition_rule_c": {"type": "text", "index": 137, "name": "blng_revenue_recognition_rule_c", "comment": null}, "blng_tax_rule_c": {"type": "text", "index": 138, "name": "blng_tax_rule_c", "comment": null}, "deployment_date_c": {"type": "integer", "index": 139, "name": "deployment_date_c", "comment": null}, "do_not_prorate_c": {"type": "boolean", "index": 140, "name": "do_not_prorate_c", "comment": null}, "celigo_sfnsio_netsuite_id_c": {"type": "integer", "index": 141, "name": "celigo_sfnsio_netsuite_id_c", "comment": null}, "sbqq_enable_large_configuration_c": {"type": "boolean", "index": 142, "name": "sbqq_enable_large_configuration_c", "comment": null}, "sbqq_pricing_guidance_c": {"type": "integer", "index": 143, "name": "sbqq_pricing_guidance_c", "comment": null}, "celigo_sfnsio_item_pricing_type_c": {"type": "integer", "index": 144, "name": "celigo_sfnsio_item_pricing_type_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 145, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_celigo_last_modified_date_c": {"type": "timestamp without time zone", "index": 146, "name": "celigo_sfnsio_celigo_last_modified_date_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 147, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 148, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_item_type_c": {"type": "integer", "index": 149, "name": "celigo_sfnsio_net_suite_item_type_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 150, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "promo_code_c": {"type": "integer", "index": 151, "name": "promo_code_c", "comment": null}, "product_category_c": {"type": "integer", "index": 152, "name": "product_category_c", "comment": null}, "product_source_c": {"type": "integer", "index": 153, "name": "product_source_c", "comment": null}, "non_recurring_c": {"type": "boolean", "index": 154, "name": "non_recurring_c", "comment": null}, "is_archived": {"type": "boolean", "index": 155, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 156, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_product_2_data"}, "seed.salesforce_integration_tests.sf_task_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"referral_account_c": {"type": "integer", "index": 1, "name": "referral_account_c", "comment": null}, "who_id": {"type": "text", "index": 2, "name": "who_id", "comment": null}, "call_disposition": {"type": "integer", "index": 3, "name": "call_disposition", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 4, "name": "recurrence_day_of_month", "comment": null}, "owner_id": {"type": "text", "index": 5, "name": "owner_id", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 6, "name": "recurrence_end_date_only", "comment": null}, "subject": {"type": "text", "index": 7, "name": "subject", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 9, "name": "last_modified_date", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 10, "name": "recurrence_time_zone_sid_key", "comment": null}, "is_recurrence": {"type": "boolean", "index": 11, "name": "is_recurrence", "comment": null}, "what_count": {"type": "integer", "index": 12, "name": "what_count", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "call_object": {"type": "integer", "index": 14, "name": "call_object", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 16, "name": "recurrence_day_of_week_mask", "comment": null}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 18, "name": "system_modstamp", "comment": null}, "recurrence_regenerated_type": {"type": "integer", "index": 19, "name": "recurrence_regenerated_type", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "recurrence_type": {"type": "integer", "index": 21, "name": "recurrence_type", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 22, "name": "reminder_date_time", "comment": null}, "call_type": {"type": "integer", "index": 23, "name": "call_type", "comment": null}, "is_high_priority": {"type": "boolean", "index": 24, "name": "is_high_priority", "comment": null}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 26, "name": "recurrence_month_of_year", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 27, "name": "is_reminder_set", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 28, "name": "activity_date", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "priority": {"type": "text", "index": 30, "name": "priority", "comment": null}, "recurrence_interval": {"type": "integer", "index": 31, "name": "recurrence_interval", "comment": null}, "who_count": {"type": "integer", "index": 32, "name": "who_count", "comment": null}, "recurrence_start_date_only": {"type": "timestamp without time zone", "index": 33, "name": "recurrence_start_date_only", "comment": null}, "account_id": {"type": "text", "index": 34, "name": "account_id", "comment": null}, "referral_contact_c": {"type": "integer", "index": 35, "name": "referral_contact_c", "comment": null}, "call_duration_in_seconds": {"type": "integer", "index": 36, "name": "call_duration_in_seconds", "comment": null}, "created_by_id": {"type": "text", "index": 37, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 38, "name": "created_date", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 39, "name": "recurrence_activity_id", "comment": null}, "what_id": {"type": "text", "index": 40, "name": "what_id", "comment": null}, "task_subtype": {"type": "text", "index": 41, "name": "task_subtype", "comment": null}, "status": {"type": "text", "index": 42, "name": "status", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 43, "name": "invitee_uuid_c", "comment": null}, "type": {"type": "text", "index": 44, "name": "type", "comment": null}, "no_show_c": {"type": "boolean", "index": 45, "name": "no_show_c", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 46, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 47, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 48, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 49, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 50, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 52, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 53, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 54, "name": "lid_date_sent_c", "comment": null}, "record_type_id": {"type": "text", "index": 55, "name": "record_type_id", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "completed_date_time": {"type": "timestamp without time zone", "index": 78, "name": "completed_date_time", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 79, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 80, "name": "partner_contact_c", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 81, "name": "co_selling_activity_c", "comment": null}, "description_c": {"type": "integer", "index": 82, "name": "description_c", "comment": null}, "co_sell_partner_account_c": {"type": "integer", "index": 83, "name": "co_sell_partner_account_c", "comment": null}, "campaign_c": {"type": "integer", "index": 84, "name": "campaign_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 85, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 86, "name": "topic_c", "comment": null}, "event_name_c": {"type": "integer", "index": 87, "name": "event_name_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 88, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 89, "name": "partner_activity_type_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 90, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 91, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 92, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 93, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 94, "name": "vidyard_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 95, "name": "expected_payment_date_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 96, "name": "execute_collections_plan_activity_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 97, "name": "collections_hold_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 98, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "text", "index": 99, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "text", "index": 100, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 101, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 102, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "text", "index": 103, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "text", "index": 104, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 105, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 106, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 107, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_task_data"}, "seed.salesforce_integration_tests.sf_user_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "about_me": {"type": "integer", "index": 3, "name": "about_me", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "alias": {"type": "text", "index": 5, "name": "alias", "comment": null}, "badge_text": {"type": "text", "index": 6, "name": "badge_text", "comment": null}, "banner_photo_url": {"type": "text", "index": 7, "name": "banner_photo_url", "comment": null}, "call_center_id": {"type": "integer", "index": 8, "name": "call_center_id", "comment": null}, "city": {"type": "integer", "index": 9, "name": "city", "comment": null}, "community_nickname": {"type": "text", "index": 10, "name": "community_nickname", "comment": null}, "company_name": {"type": "integer", "index": 11, "name": "company_name", "comment": null}, "contact_id": {"type": "integer", "index": 12, "name": "contact_id", "comment": null}, "country": {"type": "text", "index": 13, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 14, "name": "country_code", "comment": null}, "default_group_notification_frequency": {"type": "text", "index": 15, "name": "default_group_notification_frequency", "comment": null}, "delegated_approver_id": {"type": "text", "index": 16, "name": "delegated_approver_id", "comment": null}, "department": {"type": "integer", "index": 17, "name": "department", "comment": null}, "digest_frequency": {"type": "text", "index": 18, "name": "digest_frequency", "comment": null}, "division": {"type": "integer", "index": 19, "name": "division", "comment": null}, "email": {"type": "text", "index": 20, "name": "email", "comment": null}, "email_encoding_key": {"type": "text", "index": 21, "name": "email_encoding_key", "comment": null}, "email_preferences_auto_bcc": {"type": "boolean", "index": 22, "name": "email_preferences_auto_bcc", "comment": null}, "employee_number": {"type": "integer", "index": 23, "name": "employee_number", "comment": null}, "extension": {"type": "integer", "index": 24, "name": "extension", "comment": null}, "fax": {"type": "integer", "index": 25, "name": "fax", "comment": null}, "federation_identifier": {"type": "integer", "index": 26, "name": "federation_identifier", "comment": null}, "first_name": {"type": "text", "index": 27, "name": "first_name", "comment": null}, "forecast_enabled": {"type": "boolean", "index": 28, "name": "forecast_enabled", "comment": null}, "full_photo_url": {"type": "text", "index": 29, "name": "full_photo_url", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 30, "name": "geocode_accuracy", "comment": null}, "id": {"type": "text", "index": 31, "name": "id", "comment": null}, "individual_id": {"type": "integer", "index": 32, "name": "individual_id", "comment": null}, "is_active": {"type": "boolean", "index": 33, "name": "is_active", "comment": null}, "is_profile_photo_active": {"type": "boolean", "index": 34, "name": "is_profile_photo_active", "comment": null}, "language_locale_key": {"type": "text", "index": 35, "name": "language_locale_key", "comment": null}, "last_login_date": {"type": "timestamp without time zone", "index": 36, "name": "last_login_date", "comment": null}, "last_name": {"type": "text", "index": 37, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 38, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 39, "name": "last_viewed_date", "comment": null}, "latitude": {"type": "double precision", "index": 40, "name": "latitude", "comment": null}, "locale_sid_key": {"type": "text", "index": 41, "name": "locale_sid_key", "comment": null}, "longitude": {"type": "double precision", "index": 42, "name": "longitude", "comment": null}, "manager_id": {"type": "text", "index": 43, "name": "manager_id", "comment": null}, "medium_banner_photo_url": {"type": "text", "index": 44, "name": "medium_banner_photo_url", "comment": null}, "mobile_phone": {"type": "integer", "index": 45, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 46, "name": "name", "comment": null}, "offline_trial_expiration_date": {"type": "timestamp without time zone", "index": 47, "name": "offline_trial_expiration_date", "comment": null}, "phone": {"type": "text", "index": 48, "name": "phone", "comment": null}, "postal_code": {"type": "integer", "index": 49, "name": "postal_code", "comment": null}, "profile_id": {"type": "text", "index": 50, "name": "profile_id", "comment": null}, "receives_admin_info_emails": {"type": "boolean", "index": 51, "name": "receives_admin_info_emails", "comment": null}, "receives_info_emails": {"type": "boolean", "index": 52, "name": "receives_info_emails", "comment": null}, "sender_email": {"type": "integer", "index": 53, "name": "sender_email", "comment": null}, "sender_name": {"type": "integer", "index": 54, "name": "sender_name", "comment": null}, "signature": {"type": "integer", "index": 55, "name": "signature", "comment": null}, "small_banner_photo_url": {"type": "text", "index": 56, "name": "small_banner_photo_url", "comment": null}, "small_photo_url": {"type": "text", "index": 57, "name": "small_photo_url", "comment": null}, "state": {"type": "integer", "index": 58, "name": "state", "comment": null}, "state_code": {"type": "integer", "index": 59, "name": "state_code", "comment": null}, "street": {"type": "integer", "index": 60, "name": "street", "comment": null}, "time_zone_sid_key": {"type": "text", "index": 61, "name": "time_zone_sid_key", "comment": null}, "title": {"type": "text", "index": 62, "name": "title", "comment": null}, "user_role_id": {"type": "text", "index": 63, "name": "user_role_id", "comment": null}, "user_type": {"type": "text", "index": 64, "name": "user_type", "comment": null}, "username": {"type": "text", "index": 65, "name": "username", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 66, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_user_data"}, "seed.salesforce_integration_tests.sf_user_role_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "case_access_for_account_owner": {"type": "text", "index": 3, "name": "case_access_for_account_owner", "comment": null}, "contact_access_for_account_owner": {"type": "text", "index": 4, "name": "contact_access_for_account_owner", "comment": null}, "developer_name": {"type": "text", "index": 5, "name": "developer_name", "comment": null}, "forecast_user_id": {"type": "integer", "index": 6, "name": "forecast_user_id", "comment": null}, "id": {"type": "text", "index": 7, "name": "id", "comment": null}, "may_forecast_manager_share": {"type": "boolean", "index": 8, "name": "may_forecast_manager_share", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "opportunity_access_for_account_owner": {"type": "text", "index": 10, "name": "opportunity_access_for_account_owner", "comment": null}, "parent_role_id": {"type": "text", "index": 11, "name": "parent_role_id", "comment": null}, "portal_type": {"type": "text", "index": 12, "name": "portal_type", "comment": null}, "rollup_description": {"type": "text", "index": 13, "name": "rollup_description", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 14, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_user_role_data"}, "model.salesforce_source.stg_salesforce__account": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__account", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "text", "index": 2, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": null}, "annual_revenue": {"type": "numeric(28,6)", "index": 4, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 7, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 8, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 9, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 10, "name": "billing_street", "comment": null}, "account_description": {"type": "text", "index": 11, "name": "account_description", "comment": null}, "account_id": {"type": "text", "index": 12, "name": "account_id", "comment": null}, "industry": {"type": "text", "index": 13, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 15, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 16, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 17, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 18, "name": "master_record_id", "comment": null}, "account_name": {"type": "text", "index": 19, "name": "account_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 20, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 21, "name": "owner_id", "comment": null}, "ownership": {"type": "text", "index": 22, "name": "ownership", "comment": null}, "parent_id": {"type": "text", "index": 23, "name": "parent_id", "comment": null}, "rating": {"type": "text", "index": 24, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 25, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "text", "index": 26, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 27, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 28, "name": "shipping_country_code", "comment": null}, "shipping_postal_code": {"type": "text", "index": 29, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 30, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "text", "index": 31, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 32, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 33, "name": "type", "comment": null}, "website": {"type": "text", "index": 34, "name": "website", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__account"}, "model.salesforce_source.stg_salesforce__account_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__account_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "text", "index": 1, "name": "account_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 8, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 9, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 10, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 11, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 12, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 13, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 14, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 16, "name": "description", "comment": null}, "industry": {"type": "text", "index": 17, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 18, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 19, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 20, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 21, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 22, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 23, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 24, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 26, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 27, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 28, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 30, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 31, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 32, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 33, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 34, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "website": {"type": "text", "index": 36, "name": "website", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__account_history"}, "model.salesforce_source.stg_salesforce__contact": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__contact", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "contact_id": {"type": "text", "index": 2, "name": "contact_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "department": {"type": "text", "index": 4, "name": "department", "comment": null}, "contact_description": {"type": "text", "index": 5, "name": "contact_description", "comment": null}, "email": {"type": "text", "index": 6, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 7, "name": "first_name", "comment": null}, "home_phone": {"type": "text", "index": 8, "name": "home_phone", "comment": null}, "individual_id": {"type": "text", "index": 9, "name": "individual_id", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 11, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 13, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 14, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 15, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 16, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 17, "name": "lead_source", "comment": null}, "mailing_city": {"type": "text", "index": 18, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 19, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 20, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "text", "index": 21, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 22, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 23, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 24, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "text", "index": 25, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "text", "index": 26, "name": "mobile_phone", "comment": null}, "contact_name": {"type": "text", "index": 27, "name": "contact_name", "comment": null}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 29, "name": "phone", "comment": null}, "reports_to_id": {"type": "text", "index": 30, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 31, "name": "title", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__contact"}, "model.salesforce_source.stg_salesforce__contact_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__contact_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"contact_id": {"type": "text", "index": 1, "name": "contact_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 8, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 9, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 10, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 12, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 14, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 15, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 16, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 17, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 18, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 19, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 20, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 21, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 22, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 23, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 24, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 25, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 28, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 29, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 30, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 32, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 33, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 34, "name": "home_phone", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__contact_history"}, "model.salesforce_source.stg_salesforce__event": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "event_description": {"type": "text", "index": 8, "name": "event_description", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 9, "name": "end_date", "comment": null}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": null}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": null}, "group_event_type": {"type": "text", "index": 12, "name": "group_event_type", "comment": null}, "is_archived": {"type": "boolean", "index": 13, "name": "is_archived", "comment": null}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": null}, "is_recurrence": {"type": "boolean", "index": 17, "name": "is_recurrence", "comment": null}, "last_modified_by_id": {"type": "text", "index": 18, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 19, "name": "last_modified_date", "comment": null}, "location": {"type": "text", "index": 20, "name": "location", "comment": null}, "owner_id": {"type": "text", "index": 21, "name": "owner_id", "comment": null}, "start_date_time": {"type": "timestamp without time zone", "index": 22, "name": "start_date_time", "comment": null}, "subject": {"type": "text", "index": 23, "name": "subject", "comment": null}, "type": {"type": "text", "index": 24, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 25, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 26, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 27, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 28, "name": "who_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.salesforce_source.stg_salesforce__event"}, "model.salesforce_source.stg_salesforce__lead": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__lead", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "lead_id": {"type": "text", "index": 2, "name": "lead_id", "comment": null}, "annual_revenue": {"type": "numeric(28,6)", "index": 3, "name": "annual_revenue", "comment": null}, "city": {"type": "text", "index": 4, "name": "city", "comment": null}, "company": {"type": "text", "index": 5, "name": "company", "comment": null}, "converted_account_id": {"type": "text", "index": 6, "name": "converted_account_id", "comment": null}, "converted_contact_id": {"type": "text", "index": 7, "name": "converted_contact_id", "comment": null}, "converted_date": {"type": "timestamp without time zone", "index": 8, "name": "converted_date", "comment": null}, "converted_opportunity_id": {"type": "text", "index": 9, "name": "converted_opportunity_id", "comment": null}, "country": {"type": "text", "index": 10, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 11, "name": "country_code", "comment": null}, "created_by_id": {"type": "text", "index": 12, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 13, "name": "created_date", "comment": null}, "lead_description": {"type": "text", "index": 14, "name": "lead_description", "comment": null}, "email": {"type": "text", "index": 15, "name": "email", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 16, "name": "email_bounced_date", "comment": null}, "email_bounced_reason": {"type": "text", "index": 17, "name": "email_bounced_reason", "comment": null}, "first_name": {"type": "text", "index": 18, "name": "first_name", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 19, "name": "has_opted_out_of_email", "comment": null}, "individual_id": {"type": "text", "index": 20, "name": "individual_id", "comment": null}, "industry": {"type": "text", "index": 21, "name": "industry", "comment": null}, "is_converted": {"type": "boolean", "index": 22, "name": "is_converted", "comment": null}, "is_deleted": {"type": "boolean", "index": 23, "name": "is_deleted", "comment": null}, "is_unread_by_owner": {"type": "boolean", "index": 24, "name": "is_unread_by_owner", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 25, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 28, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 29, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 30, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": null}, "master_record_id": {"type": "text", "index": 32, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "text", "index": 33, "name": "mobile_phone", "comment": null}, "lead_name": {"type": "text", "index": 34, "name": "lead_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 35, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 36, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 37, "name": "phone", "comment": null}, "postal_code": {"type": "text", "index": 38, "name": "postal_code", "comment": null}, "state": {"type": "text", "index": 39, "name": "state", "comment": null}, "state_code": {"type": "text", "index": 40, "name": "state_code", "comment": null}, "status": {"type": "text", "index": 41, "name": "status", "comment": null}, "street": {"type": "text", "index": 42, "name": "street", "comment": null}, "title": {"type": "text", "index": 43, "name": "title", "comment": null}, "website": {"type": "text", "index": 44, "name": "website", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__lead"}, "model.salesforce_source.stg_salesforce__opportunity": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__opportunity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "numeric(28,6)", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "opportunity_description": {"type": "text", "index": 7, "name": "opportunity_description", "comment": null}, "expected_revenue": {"type": "numeric(28,6)", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 20, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 24, "name": "lead_source", "comment": null}, "opportunity_name": {"type": "text", "index": 25, "name": "opportunity_name", "comment": null}, "next_step": {"type": "text", "index": 26, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "probability": {"type": "double precision", "index": 28, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 30, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "text", "index": 31, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 32, "name": "type", "comment": null}, "is_created_this_month": {"type": "boolean", "index": 33, "name": "is_created_this_month", "comment": null}, "is_created_this_quarter": {"type": "boolean", "index": 34, "name": "is_created_this_quarter", "comment": null}, "days_since_created": {"type": "integer", "index": 35, "name": "days_since_created", "comment": null}, "days_to_close": {"type": "integer", "index": 36, "name": "days_to_close", "comment": null}, "is_closed_this_month": {"type": "boolean", "index": 37, "name": "is_closed_this_month", "comment": null}, "is_closed_this_quarter": {"type": "boolean", "index": 38, "name": "is_closed_this_quarter", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__opportunity"}, "model.salesforce_source.stg_salesforce__opportunity_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__opportunity_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"opportunity_id": {"type": "text", "index": 1, "name": "opportunity_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 8, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 9, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 10, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 11, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 12, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 13, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 14, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 15, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 16, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 17, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 18, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 19, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 20, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 21, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 22, "name": "has_overdue_task", "comment": null}, "is_closed": {"type": "boolean", "index": 23, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 25, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 26, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 27, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 28, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 30, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 31, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 33, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 34, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 35, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 36, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 37, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_history"}, "model.salesforce_source.stg_salesforce__opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__opportunity_line_item", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "opportunity_line_item_id": {"type": "text", "index": 2, "name": "opportunity_line_item_id", "comment": null}, "created_by_id": {"type": "text", "index": 3, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 4, "name": "created_date", "comment": null}, "opportunity_line_item_description": {"type": "text", "index": 5, "name": "opportunity_line_item_description", "comment": null}, "discount": {"type": "double precision", "index": 6, "name": "discount", "comment": null}, "has_quantity_schedule": {"type": "boolean", "index": 7, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "boolean", "index": 8, "name": "has_revenue_schedule", "comment": null}, "has_schedule": {"type": "boolean", "index": 9, "name": "has_schedule", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 13, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 14, "name": "last_viewed_date", "comment": null}, "list_price": {"type": "numeric(28,6)", "index": 15, "name": "list_price", "comment": null}, "opportunity_line_item_name": {"type": "text", "index": 16, "name": "opportunity_line_item_name", "comment": null}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 18, "name": "pricebook_entry_id", "comment": null}, "product_2_id": {"type": "text", "index": 19, "name": "product_2_id", "comment": null}, "product_code": {"type": "text", "index": 20, "name": "product_code", "comment": null}, "quantity": {"type": "double precision", "index": 21, "name": "quantity", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 22, "name": "service_date", "comment": null}, "sort_order": {"type": "integer", "index": 23, "name": "sort_order", "comment": null}, "total_price": {"type": "numeric(28,6)", "index": 24, "name": "total_price", "comment": null}, "unit_price": {"type": "numeric(28,6)", "index": 25, "name": "unit_price", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_line_item"}, "model.salesforce_source.stg_salesforce__order": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__order", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "order_id": {"type": "text", "index": 2, "name": "order_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": null}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": null}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "text", "index": 8, "name": "billing_country_code", "comment": null}, "billing_postal_code": {"type": "text", "index": 9, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 10, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 11, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": null}, "contract_id": {"type": "text", "index": 13, "name": "contract_id", "comment": null}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": null}, "order_description": {"type": "text", "index": 16, "name": "order_description", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 17, "name": "end_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 18, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 19, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 20, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 21, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 22, "name": "last_viewed_date", "comment": null}, "opportunity_id": {"type": "text", "index": 23, "name": "opportunity_id", "comment": null}, "order_number": {"type": "text", "index": 24, "name": "order_number", "comment": null}, "original_order_id": {"type": "text", "index": 25, "name": "original_order_id", "comment": null}, "owner_id": {"type": "text", "index": 26, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 27, "name": "pricebook_2_id", "comment": null}, "shipping_city": {"type": "text", "index": 28, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 30, "name": "shipping_country_code", "comment": null}, "shipping_postal_code": {"type": "text", "index": 31, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 32, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "text", "index": 33, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 34, "name": "shipping_street", "comment": null}, "status": {"type": "text", "index": 35, "name": "status", "comment": null}, "total_amount": {"type": "numeric(28,6)", "index": 36, "name": "total_amount", "comment": null}, "type": {"type": "text", "index": 37, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__order"}, "model.salesforce_source.stg_salesforce__product_2": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__product_2", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "product_2_id": {"type": "text", "index": 2, "name": "product_2_id", "comment": null}, "created_by_id": {"type": "text", "index": 3, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 4, "name": "created_date", "comment": null}, "product_2_description": {"type": "text", "index": 5, "name": "product_2_description", "comment": null}, "display_url": {"type": "text", "index": 6, "name": "display_url", "comment": null}, "external_id": {"type": "text", "index": 7, "name": "external_id", "comment": null}, "family": {"type": "text", "index": 8, "name": "family", "comment": null}, "is_active": {"type": "boolean", "index": 9, "name": "is_active", "comment": null}, "is_archived": {"type": "boolean", "index": 10, "name": "is_archived", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 13, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 14, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": null}, "product_2_name": {"type": "text", "index": 16, "name": "product_2_name", "comment": null}, "number_of_quantity_installments": {"type": "integer", "index": 17, "name": "number_of_quantity_installments", "comment": null}, "number_of_revenue_installments": {"type": "integer", "index": 18, "name": "number_of_revenue_installments", "comment": null}, "product_code": {"type": "text", "index": 19, "name": "product_code", "comment": null}, "quantity_installment_period": {"type": "text", "index": 20, "name": "quantity_installment_period", "comment": null}, "quantity_schedule_type": {"type": "text", "index": 21, "name": "quantity_schedule_type", "comment": null}, "quantity_unit_of_measure": {"type": "text", "index": 22, "name": "quantity_unit_of_measure", "comment": null}, "record_type_id": {"type": "text", "index": 23, "name": "record_type_id", "comment": null}, "revenue_installment_period": {"type": "text", "index": 24, "name": "revenue_installment_period", "comment": null}, "revenue_schedule_type": {"type": "text", "index": 25, "name": "revenue_schedule_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__product_2"}, "model.salesforce_source.stg_salesforce__task": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__task", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "task_id": {"type": "text", "index": 2, "name": "task_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "call_disposition": {"type": "text", "index": 5, "name": "call_disposition", "comment": null}, "call_duration_in_seconds": {"type": "integer", "index": 6, "name": "call_duration_in_seconds", "comment": null}, "call_object": {"type": "text", "index": 7, "name": "call_object", "comment": null}, "call_type": {"type": "text", "index": 8, "name": "call_type", "comment": null}, "completed_date_time": {"type": "timestamp without time zone", "index": 9, "name": "completed_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 10, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 11, "name": "created_date", "comment": null}, "task_description": {"type": "text", "index": 12, "name": "task_description", "comment": null}, "is_archived": {"type": "boolean", "index": 13, "name": "is_archived", "comment": null}, "is_closed": {"type": "boolean", "index": 14, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_high_priority": {"type": "boolean", "index": 16, "name": "is_high_priority", "comment": null}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 18, "name": "last_modified_date", "comment": null}, "owner_id": {"type": "text", "index": 19, "name": "owner_id", "comment": null}, "priority": {"type": "text", "index": 20, "name": "priority", "comment": null}, "record_type_id": {"type": "text", "index": 21, "name": "record_type_id", "comment": null}, "status": {"type": "text", "index": 22, "name": "status", "comment": null}, "subject": {"type": "text", "index": 23, "name": "subject", "comment": null}, "task_subtype": {"type": "text", "index": 24, "name": "task_subtype", "comment": null}, "type": {"type": "text", "index": 25, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 26, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 27, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 28, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 29, "name": "who_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.salesforce_source.stg_salesforce__task"}, "model.salesforce_source.stg_salesforce__user": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__user", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "alias": {"type": "text", "index": 4, "name": "alias", "comment": null}, "city": {"type": "text", "index": 5, "name": "city", "comment": null}, "company_name": {"type": "text", "index": 6, "name": "company_name", "comment": null}, "contact_id": {"type": "text", "index": 7, "name": "contact_id", "comment": null}, "country": {"type": "text", "index": 8, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 9, "name": "country_code", "comment": null}, "department": {"type": "text", "index": 10, "name": "department", "comment": null}, "email": {"type": "text", "index": 11, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 12, "name": "first_name", "comment": null}, "user_id": {"type": "text", "index": 13, "name": "user_id", "comment": null}, "individual_id": {"type": "text", "index": 14, "name": "individual_id", "comment": null}, "is_active": {"type": "boolean", "index": 15, "name": "is_active", "comment": null}, "last_login_date": {"type": "timestamp without time zone", "index": 16, "name": "last_login_date", "comment": null}, "last_name": {"type": "text", "index": 17, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "manager_id": {"type": "text", "index": 20, "name": "manager_id", "comment": null}, "user_name": {"type": "text", "index": 21, "name": "user_name", "comment": null}, "postal_code": {"type": "text", "index": 22, "name": "postal_code", "comment": null}, "profile_id": {"type": "text", "index": 23, "name": "profile_id", "comment": null}, "state": {"type": "text", "index": 24, "name": "state", "comment": null}, "state_code": {"type": "text", "index": 25, "name": "state_code", "comment": null}, "street": {"type": "text", "index": 26, "name": "street", "comment": null}, "title": {"type": "text", "index": 27, "name": "title", "comment": null}, "user_role_id": {"type": "text", "index": 28, "name": "user_role_id", "comment": null}, "user_type": {"type": "text", "index": 29, "name": "user_type", "comment": null}, "username": {"type": "text", "index": 30, "name": "username", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__user"}, "model.salesforce_source.stg_salesforce__user_role": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__user_role", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "developer_name": {"type": "text", "index": 3, "name": "developer_name", "comment": null}, "user_role_id": {"type": "text", "index": 4, "name": "user_role_id", "comment": null}, "user_role_name": {"type": "text", "index": 5, "name": "user_role_name", "comment": null}, "opportunity_access_for_account_owner": {"type": "text", "index": 6, "name": "opportunity_access_for_account_owner", "comment": null}, "parent_role_id": {"type": "text", "index": 7, "name": "parent_role_id", "comment": null}, "rollup_description": {"type": "text", "index": 8, "name": "rollup_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.salesforce_source.stg_salesforce__user_role"}, "model.salesforce.int_salesforce__date_spine": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "int_salesforce__date_spine", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "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.salesforce.int_salesforce__date_spine"}, "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "int_salesforce__opportunity_aggregation_by_owner", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"owner_id": {"type": "text", "index": 1, "name": "owner_id", "comment": null}, "manager_id": {"type": "text", "index": 2, "name": "manager_id", "comment": null}, "b_manager_id": {"type": "text", "index": 3, "name": "b_manager_id", "comment": null}, "b_owner_id": {"type": "text", "index": 4, "name": "b_owner_id", "comment": null}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 5, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 6, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "bigint", "index": 7, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 8, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "bigint", "index": 9, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 10, "name": "bookings_count_closed_this_quarter", "comment": null}, "avg_bookings_amount": {"type": "numeric", "index": 11, "name": "avg_bookings_amount", "comment": null}, "largest_booking": {"type": "numeric", "index": 12, "name": "largest_booking", "comment": null}, "avg_days_to_close": {"type": "numeric", "index": 13, "name": "avg_days_to_close", "comment": null}, "l_manager_id": {"type": "text", "index": 14, "name": "l_manager_id", "comment": null}, "l_owner_id": {"type": "text", "index": 15, "name": "l_owner_id", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 16, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 17, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "bigint", "index": 18, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 19, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "bigint", "index": 20, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "bigint", "index": 21, "name": "lost_count_this_quarter", "comment": null}, "p_manager_id": {"type": "text", "index": 22, "name": "p_manager_id", "comment": null}, "p_owner_id": {"type": "text", "index": 23, "name": "p_owner_id", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 24, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 26, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 27, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "bigint", "index": 28, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 29, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "bigint", "index": 30, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 31, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 32, "name": "total_pipeline_forecast_amount", "comment": null}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 33, "name": "avg_pipeline_opp_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 34, "name": "largest_deal_in_pipeline", "comment": null}, "avg_days_open": {"type": "numeric", "index": 35, "name": "avg_days_open", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.int_salesforce__opportunity_aggregation_by_owner"}, "model.salesforce.salesforce__account_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__account_daily_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_day_id": {"type": "text", "index": 1, "name": "account_day_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 10, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 11, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 12, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 13, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 14, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 15, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 16, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 17, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 18, "name": "description", "comment": null}, "industry": {"type": "text", "index": 19, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 20, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 30, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 32, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 33, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 34, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 35, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 36, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 37, "name": "type", "comment": null}, "website": {"type": "text", "index": 38, "name": "website", "comment": null}, "row_num": {"type": "bigint", "index": 39, "name": "row_num", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__account_daily_history"}, "model.salesforce.salesforce__contact_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__contact_daily_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"contact_day_id": {"type": "text", "index": 1, "name": "contact_day_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "contact_id": {"type": "text", "index": 3, "name": "contact_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 10, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 11, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 12, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 13, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 14, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 15, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 16, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 17, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 20, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 21, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 22, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 23, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 24, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 25, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 26, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 27, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 29, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 31, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 32, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 33, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 34, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 35, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 36, "name": "home_phone", "comment": null}, "row_num": {"type": "bigint", "index": 37, "name": "row_num", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__contact_daily_history"}, "model.salesforce.salesforce__contact_enhanced": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__contact_enhanced", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"contact_id": {"type": "text", "index": 1, "name": "contact_id", "comment": null}, "contact_name": {"type": "text", "index": 2, "name": "contact_name", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "department": {"type": "text", "index": 4, "name": "department", "comment": null}, "contact_description": {"type": "text", "index": 5, "name": "contact_description", "comment": null}, "email": {"type": "text", "index": 6, "name": "email", "comment": null}, "individual_id": {"type": "text", "index": 7, "name": "individual_id", "comment": null}, "contact_is_deleted": {"type": "boolean", "index": 8, "name": "contact_is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 9, "name": "last_activity_date", "comment": null}, "lead_source": {"type": "text", "index": 10, "name": "lead_source", "comment": null}, "mailing_city": {"type": "text", "index": 11, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 12, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 13, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "text", "index": 14, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 15, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 16, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 17, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "text", "index": 18, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "text", "index": 19, "name": "mobile_phone", "comment": null}, "contact_owner_id": {"type": "text", "index": 20, "name": "contact_owner_id", "comment": null}, "phone": {"type": "text", "index": 21, "name": "phone", "comment": null}, "reports_to_id": {"type": "text", "index": 22, "name": "reports_to_id", "comment": null}, "contact_owner_name": {"type": "text", "index": 23, "name": "contact_owner_name", "comment": null}, "account_name": {"type": "text", "index": 24, "name": "account_name", "comment": null}, "account_number": {"type": "text", "index": 25, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 26, "name": "account_source", "comment": null}, "account_annual_revenue": {"type": "numeric(28,6)", "index": 27, "name": "account_annual_revenue", "comment": null}, "account_description": {"type": "text", "index": 28, "name": "account_description", "comment": null}, "account_industry": {"type": "text", "index": 29, "name": "account_industry", "comment": null}, "account_is_deleted": {"type": "boolean", "index": 30, "name": "account_is_deleted", "comment": null}, "account_number_of_employees": {"type": "integer", "index": 31, "name": "account_number_of_employees", "comment": null}, "account_owner_id": {"type": "text", "index": 32, "name": "account_owner_id", "comment": null}, "account_parent_id": {"type": "text", "index": 33, "name": "account_parent_id", "comment": null}, "account_rating": {"type": "text", "index": 34, "name": "account_rating", "comment": null}, "account_type": {"type": "text", "index": 35, "name": "account_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__contact_enhanced"}, "model.salesforce.salesforce__daily_activity": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__daily_activity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "leads_created": {"type": "bigint", "index": 2, "name": "leads_created", "comment": null}, "leads_converted": {"type": "bigint", "index": 3, "name": "leads_converted", "comment": null}, "tasks_completed": {"type": "bigint", "index": 4, "name": "tasks_completed", "comment": null}, "events_completed": {"type": "bigint", "index": 5, "name": "events_completed", "comment": null}, "opportunities_created": {"type": "bigint", "index": 6, "name": "opportunities_created", "comment": null}, "opportunities_created_amount": {"type": "numeric", "index": 7, "name": "opportunities_created_amount", "comment": null}, "opportunities_won": {"type": "bigint", "index": 8, "name": "opportunities_won", "comment": null}, "opportunities_won_amount": {"type": "numeric", "index": 9, "name": "opportunities_won_amount", "comment": null}, "opportunities_lost": {"type": "bigint", "index": 10, "name": "opportunities_lost", "comment": null}, "opportunities_lost_amount": {"type": "numeric", "index": 11, "name": "opportunities_lost_amount", "comment": null}, "pipeline_amount": {"type": "numeric", "index": 12, "name": "pipeline_amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__daily_activity"}, "model.salesforce.salesforce__manager_performance": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__manager_performance", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"manager_id": {"type": "text", "index": 1, "name": "manager_id", "comment": null}, "manager_name": {"type": "text", "index": 2, "name": "manager_name", "comment": null}, "manager_city": {"type": "text", "index": 3, "name": "manager_city", "comment": null}, "manager_state": {"type": "text", "index": 4, "name": "manager_state", "comment": null}, "manager_position": {"type": "text", "index": 5, "name": "manager_position", "comment": null}, "number_of_direct_reports": {"type": "bigint", "index": 6, "name": "number_of_direct_reports", "comment": null}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 7, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 8, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "numeric", "index": 9, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 10, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "numeric", "index": 11, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "numeric", "index": 12, "name": "bookings_count_closed_this_quarter", "comment": null}, "largest_booking": {"type": "numeric", "index": 13, "name": "largest_booking", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 14, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 15, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "numeric", "index": 16, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 17, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "numeric", "index": 18, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "numeric", "index": 19, "name": "lost_count_this_quarter", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 20, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 21, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 22, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 23, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "numeric", "index": 24, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "numeric", "index": 26, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 27, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 28, "name": "total_pipeline_forecast_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 29, "name": "largest_deal_in_pipeline", "comment": null}, "win_percent_this_month": {"type": "numeric", "index": 30, "name": "win_percent_this_month", "comment": null}, "win_percent_this_quarter": {"type": "numeric", "index": 31, "name": "win_percent_this_quarter", "comment": null}, "total_win_percent": {"type": "numeric", "index": 32, "name": "total_win_percent", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__manager_performance"}, "model.salesforce.salesforce__opportunity_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__opportunity_daily_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"opportunity_day_id": {"type": "text", "index": 1, "name": "opportunity_day_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "opportunity_id": {"type": "text", "index": 3, "name": "opportunity_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 10, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 11, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 12, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 13, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 14, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 15, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 16, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 17, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 18, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 19, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 20, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 21, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 22, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 23, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 24, "name": "has_overdue_task", "comment": null}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 26, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 27, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 28, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 29, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 30, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 32, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 33, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 34, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 35, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 36, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 37, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 38, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 39, "name": "type", "comment": null}, "row_num": {"type": "bigint", "index": 40, "name": "row_num", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__opportunity_daily_history"}, "model.salesforce.salesforce__opportunity_enhanced": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__opportunity_enhanced", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "numeric(28,6)", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "opportunity_description": {"type": "text", "index": 7, "name": "opportunity_description", "comment": null}, "expected_revenue": {"type": "numeric(28,6)", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 20, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 24, "name": "lead_source", "comment": null}, "opportunity_name": {"type": "text", "index": 25, "name": "opportunity_name", "comment": null}, "next_step": {"type": "text", "index": 26, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "probability": {"type": "double precision", "index": 28, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 30, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "text", "index": 31, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 32, "name": "type", "comment": null}, "is_created_this_month": {"type": "boolean", "index": 33, "name": "is_created_this_month", "comment": null}, "is_created_this_quarter": {"type": "boolean", "index": 34, "name": "is_created_this_quarter", "comment": null}, "days_since_created": {"type": "integer", "index": 35, "name": "days_since_created", "comment": null}, "days_to_close": {"type": "integer", "index": 36, "name": "days_to_close", "comment": null}, "is_closed_this_month": {"type": "boolean", "index": 37, "name": "is_closed_this_month", "comment": null}, "is_closed_this_quarter": {"type": "boolean", "index": 38, "name": "is_closed_this_quarter", "comment": null}, "account_number": {"type": "text", "index": 39, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 40, "name": "account_source", "comment": null}, "industry": {"type": "text", "index": 41, "name": "industry", "comment": null}, "account_name": {"type": "text", "index": 42, "name": "account_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 43, "name": "number_of_employees", "comment": null}, "account_type": {"type": "text", "index": 44, "name": "account_type", "comment": null}, "opportunity_owner_id": {"type": "text", "index": 45, "name": "opportunity_owner_id", "comment": null}, "opportunity_owner_name": {"type": "text", "index": 46, "name": "opportunity_owner_name", "comment": null}, "opportunity_owner_role_id": {"type": "text", "index": 47, "name": "opportunity_owner_role_id", "comment": null}, "opportunity_owner_city": {"type": "text", "index": 48, "name": "opportunity_owner_city", "comment": null}, "opportunity_owner_state": {"type": "text", "index": 49, "name": "opportunity_owner_state", "comment": null}, "opportunity_manager_id": {"type": "text", "index": 50, "name": "opportunity_manager_id", "comment": null}, "opportunity_manager_name": {"type": "text", "index": 51, "name": "opportunity_manager_name", "comment": null}, "opportunity_manager_city": {"type": "text", "index": 52, "name": "opportunity_manager_city", "comment": null}, "opportunity_manager_state": {"type": "text", "index": 53, "name": "opportunity_manager_state", "comment": null}, "opportunity_owner_position": {"type": "text", "index": 54, "name": "opportunity_owner_position", "comment": null}, "opportunity_owner_developer_name": {"type": "text", "index": 55, "name": "opportunity_owner_developer_name", "comment": null}, "opportunity_owner_parent_role_id": {"type": "text", "index": 56, "name": "opportunity_owner_parent_role_id", "comment": null}, "opportunity_owner_rollup_description": {"type": "text", "index": 57, "name": "opportunity_owner_rollup_description", "comment": null}, "status": {"type": "text", "index": 58, "name": "status", "comment": null}, "created_amount_this_month": {"type": "numeric", "index": 59, "name": "created_amount_this_month", "comment": null}, "created_amount_this_quarter": {"type": "numeric", "index": 60, "name": "created_amount_this_quarter", "comment": null}, "created_count_this_month": {"type": "integer", "index": 61, "name": "created_count_this_month", "comment": null}, "created_count_this_quarter": {"type": "integer", "index": 62, "name": "created_count_this_quarter", "comment": null}, "closed_amount_this_month": {"type": "numeric", "index": 63, "name": "closed_amount_this_month", "comment": null}, "closed_amount_this_quarter": {"type": "numeric", "index": 64, "name": "closed_amount_this_quarter", "comment": null}, "closed_count_this_month": {"type": "integer", "index": 65, "name": "closed_count_this_month", "comment": null}, "closed_count_this_quarter": {"type": "integer", "index": 66, "name": "closed_count_this_quarter", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__opportunity_enhanced"}, "model.salesforce.salesforce__opportunity_line_item_enhanced": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__opportunity_line_item_enhanced", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"opportunity_line_item_id": {"type": "text", "index": 1, "name": "opportunity_line_item_id", "comment": null}, "opportunity_line_item_name": {"type": "text", "index": 2, "name": "opportunity_line_item_name", "comment": null}, "opportunity_line_item_description": {"type": "text", "index": 3, "name": "opportunity_line_item_description", "comment": null}, "opportunity_id": {"type": "text", "index": 4, "name": "opportunity_id", "comment": null}, "line_item_index": {"type": "bigint", "index": 5, "name": "line_item_index", "comment": null}, "total_line_items": {"type": "bigint", "index": 6, "name": "total_line_items", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 9, "name": "service_date", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 10, "name": "pricebook_entry_id", "comment": null}, "product_2_id": {"type": "text", "index": 11, "name": "product_2_id", "comment": null}, "list_price": {"type": "numeric(28,6)", "index": 12, "name": "list_price", "comment": null}, "quantity": {"type": "double precision", "index": 13, "name": "quantity", "comment": null}, "unit_price": {"type": "numeric(28,6)", "index": 14, "name": "unit_price", "comment": null}, "total_price": {"type": "numeric(28,6)", "index": 15, "name": "total_price", "comment": null}, "has_quantity_schedule": {"type": "boolean", "index": 16, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "boolean", "index": 17, "name": "has_revenue_schedule", "comment": null}, "product_2_name": {"type": "text", "index": 18, "name": "product_2_name", "comment": null}, "product_code": {"type": "text", "index": 19, "name": "product_code", "comment": null}, "product_2_description": {"type": "text", "index": 20, "name": "product_2_description", "comment": null}, "product_external_id": {"type": "text", "index": 21, "name": "product_external_id", "comment": null}, "product_family": {"type": "text", "index": 22, "name": "product_family", "comment": null}, "product_is_active": {"type": "boolean", "index": 23, "name": "product_is_active", "comment": null}, "product_is_archived": {"type": "boolean", "index": 24, "name": "product_is_archived", "comment": null}, "product_is_deleted": {"type": "boolean", "index": 25, "name": "product_is_deleted", "comment": null}, "product_number_of_quantity_installments": {"type": "integer", "index": 26, "name": "product_number_of_quantity_installments", "comment": null}, "product_quantity_installment_period": {"type": "text", "index": 27, "name": "product_quantity_installment_period", "comment": null}, "product_quantity_schedule_type": {"type": "text", "index": 28, "name": "product_quantity_schedule_type", "comment": null}, "product_quantity_unit_of_measure": {"type": "text", "index": 29, "name": "product_quantity_unit_of_measure", "comment": null}, "product_number_of_revenue_installments": {"type": "integer", "index": 30, "name": "product_number_of_revenue_installments", "comment": null}, "product_revenue_installment_period": {"type": "text", "index": 31, "name": "product_revenue_installment_period", "comment": null}, "product_revenue_schedule_type": {"type": "text", "index": 32, "name": "product_revenue_schedule_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__opportunity_line_item_enhanced"}, "model.salesforce.salesforce__owner_performance": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__owner_performance", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"owner_id": {"type": "text", "index": 1, "name": "owner_id", "comment": null}, "manager_id": {"type": "text", "index": 2, "name": "manager_id", "comment": null}, "b_manager_id": {"type": "text", "index": 3, "name": "b_manager_id", "comment": null}, "b_owner_id": {"type": "text", "index": 4, "name": "b_owner_id", "comment": null}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 5, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 6, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "bigint", "index": 7, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 8, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "bigint", "index": 9, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 10, "name": "bookings_count_closed_this_quarter", "comment": null}, "avg_bookings_amount": {"type": "numeric", "index": 11, "name": "avg_bookings_amount", "comment": null}, "largest_booking": {"type": "numeric", "index": 12, "name": "largest_booking", "comment": null}, "avg_days_to_close": {"type": "numeric", "index": 13, "name": "avg_days_to_close", "comment": null}, "l_manager_id": {"type": "text", "index": 14, "name": "l_manager_id", "comment": null}, "l_owner_id": {"type": "text", "index": 15, "name": "l_owner_id", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 16, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 17, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "bigint", "index": 18, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 19, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "bigint", "index": 20, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "bigint", "index": 21, "name": "lost_count_this_quarter", "comment": null}, "p_manager_id": {"type": "text", "index": 22, "name": "p_manager_id", "comment": null}, "p_owner_id": {"type": "text", "index": 23, "name": "p_owner_id", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 24, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 26, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 27, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "bigint", "index": 28, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 29, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "bigint", "index": 30, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 31, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 32, "name": "total_pipeline_forecast_amount", "comment": null}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 33, "name": "avg_pipeline_opp_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 34, "name": "largest_deal_in_pipeline", "comment": null}, "avg_days_open": {"type": "numeric", "index": 35, "name": "avg_days_open", "comment": null}, "owner_name": {"type": "text", "index": 36, "name": "owner_name", "comment": null}, "owner_city": {"type": "text", "index": 37, "name": "owner_city", "comment": null}, "owner_state": {"type": "text", "index": 38, "name": "owner_state", "comment": null}, "win_percent_this_month": {"type": "numeric", "index": 39, "name": "win_percent_this_month", "comment": null}, "win_percent_this_quarter": {"type": "numeric", "index": 40, "name": "win_percent_this_quarter", "comment": null}, "total_win_percent": {"type": "numeric", "index": 41, "name": "total_win_percent", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__owner_performance"}, "model.salesforce.salesforce__sales_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__sales_snapshot", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"bookings_amount_closed_this_month": {"type": "numeric", "index": 1, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 2, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "bigint", "index": 3, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 4, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "bigint", "index": 5, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 6, "name": "bookings_count_closed_this_quarter", "comment": null}, "avg_bookings_amount": {"type": "numeric", "index": 7, "name": "avg_bookings_amount", "comment": null}, "largest_booking": {"type": "numeric", "index": 8, "name": "largest_booking", "comment": null}, "avg_days_to_close": {"type": "numeric", "index": 9, "name": "avg_days_to_close", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 10, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 11, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 12, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 13, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "bigint", "index": 14, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 15, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "bigint", "index": 16, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 17, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 18, "name": "total_pipeline_forecast_amount", "comment": null}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 19, "name": "avg_pipeline_opp_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 20, "name": "largest_deal_in_pipeline", "comment": null}, "avg_days_open": {"type": "numeric", "index": 21, "name": "avg_days_open", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 22, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 23, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "bigint", "index": 24, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 25, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "bigint", "index": 26, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "bigint", "index": 27, "name": "lost_count_this_quarter", "comment": null}, "win_percent_this_month": {"type": "numeric", "index": 28, "name": "win_percent_this_month", "comment": null}, "win_percent_this_quarter": {"type": "numeric", "index": 29, "name": "win_percent_this_quarter", "comment": null}, "total_win_percent": {"type": "numeric", "index": 30, "name": "total_win_percent", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__sales_snapshot"}}, "sources": {"source.salesforce_source.salesforce.account": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 2, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 4, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "text", "index": 7, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 8, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "double precision", "index": 9, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "double precision", "index": 10, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 11, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 12, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 13, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 14, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 15, "name": "description", "comment": null}, "fax": {"type": "integer", "index": 16, "name": "fax", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "industry": {"type": "text", "index": 18, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "jigsaw_company_id": {"type": "integer", "index": 20, "name": "jigsaw_company_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": null}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 31, "name": "photo_url", "comment": null}, "rating": {"type": "integer", "index": 32, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 33, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "double precision", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "double precision", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "integer", "index": 43, "name": "shipping_street", "comment": null}, "sic": {"type": "integer", "index": 44, "name": "sic", "comment": null}, "sic_desc": {"type": "integer", "index": 45, "name": "sic_desc", "comment": null}, "site": {"type": "integer", "index": 46, "name": "site", "comment": null}, "ticker_symbol": {"type": "integer", "index": 47, "name": "ticker_symbol", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "website": {"type": "text", "index": 49, "name": "website", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 50, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.account"}, "source.salesforce_source.salesforce_history.account": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 5, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 6, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 7, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 8, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 9, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 10, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 11, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 13, "name": "description", "comment": null}, "id": {"type": "text", "index": 14, "name": "id", "comment": null}, "industry": {"type": "text", "index": 15, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 16, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 20, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 21, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 22, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 23, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 24, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 25, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 26, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 27, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 28, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 30, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 31, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 32, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 33, "name": "type", "comment": null}, "website": {"type": "text", "index": 34, "name": "website", "comment": null}}, "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.salesforce_source.salesforce_history.account"}, "source.salesforce_source.salesforce.contact": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "cbit_clearbit_c": {"type": "text", "index": 4, "name": "cbit_clearbit_c", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 5, "name": "cbit_clearbit_ready_c", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "department": {"type": "integer", "index": 8, "name": "department", "comment": null}, "email": {"type": "text", "index": 9, "name": "email", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 10, "name": "email_bounced_date", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 11, "name": "email_bounced_reason", "comment": null}, "fax": {"type": "integer", "index": 12, "name": "fax", "comment": null}, "first_name": {"type": "text", "index": 13, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": null}, "is_email_bounced": {"type": "boolean", "index": 15, "name": "is_email_bounced", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 16, "name": "jigsaw_contact_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_curequest_date": {"type": "timestamp without time zone", "index": 18, "name": "last_curequest_date", "comment": null}, "last_cuupdate_date": {"type": "timestamp without time zone", "index": 19, "name": "last_cuupdate_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 22, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 25, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 26, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 27, "name": "mailing_country_code", "comment": null}, "mailing_geocode_accuracy": {"type": "integer", "index": 28, "name": "mailing_geocode_accuracy", "comment": null}, "mailing_latitude": {"type": "integer", "index": 29, "name": "mailing_latitude", "comment": null}, "mailing_longitude": {"type": "integer", "index": 30, "name": "mailing_longitude", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 31, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 32, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 33, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 34, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 35, "name": "master_record_id", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 36, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "mobile_phone": {"type": "integer", "index": 37, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 38, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 39, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 40, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 41, "name": "photo_url", "comment": null}, "reports_to_id": {"type": "integer", "index": 42, "name": "reports_to_id", "comment": null}, "salutation": {"type": "integer", "index": 43, "name": "salutation", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 44, "name": "system_modstamp", "comment": null}, "title": {"type": "text", "index": 45, "name": "title", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 46, "name": "email_bounced_c", "comment": null}, "email_quality_unknown_c": {"type": "boolean", "index": 47, "name": "email_quality_unknown_c", "comment": null}, "gclid_c": {"type": "integer", "index": 48, "name": "gclid_c", "comment": null}, "referral_account_c": {"type": "integer", "index": 49, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 50, "name": "referral_contact_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 51, "name": "has_opted_out_of_email", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 52, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 53, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 54, "name": "fivetran_user_id_c", "comment": null}, "no_longer_at_company_c": {"type": "boolean", "index": 55, "name": "no_longer_at_company_c", "comment": null}, "pi_campaign_c": {"type": "text", "index": 56, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 57, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 58, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 59, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 60, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "timestamp without time zone", "index": 61, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 62, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 63, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 64, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 65, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 66, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 67, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "boolean", "index": 68, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 69, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "boolean", "index": 70, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 71, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 72, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "text", "index": 73, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 74, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 75, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 76, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 77, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 78, "name": "pi_utm_term_c", "comment": null}, "lead_source": {"type": "text", "index": 79, "name": "lead_source", "comment": null}, "contact_status_c": {"type": "text", "index": 80, "name": "contact_status_c", "comment": null}, "region_c": {"type": "integer", "index": 81, "name": "region_c", "comment": null}, "competitor_c": {"type": "integer", "index": 82, "name": "competitor_c", "comment": null}, "bt_stripe_gender_c": {"type": "integer", "index": 83, "name": "bt_stripe_gender_c", "comment": null}, "bt_stripe_ssn_last_4_encrypted_c": {"type": "integer", "index": 84, "name": "bt_stripe_ssn_last_4_encrypted_c", "comment": null}, "bt_stripe_personal_id_number_c": {"type": "integer", "index": 85, "name": "bt_stripe_personal_id_number_c", "comment": null}, "bt_stripe_personal_id_number_encrypted_c": {"type": "integer", "index": 86, "name": "bt_stripe_personal_id_number_encrypted_c", "comment": null}, "bt_stripe_maiden_name_c": {"type": "integer", "index": 87, "name": "bt_stripe_maiden_name_c", "comment": null}, "bt_stripe_languages_c": {"type": "integer", "index": 88, "name": "bt_stripe_languages_c", "comment": null}, "bt_stripe_default_payment_method_c": {"type": "integer", "index": 89, "name": "bt_stripe_default_payment_method_c", "comment": null}, "bt_stripe_ssn_last_4_c": {"type": "integer", "index": 90, "name": "bt_stripe_ssn_last_4_c", "comment": null}, "bt_stripe_personal_id_type_c": {"type": "integer", "index": 91, "name": "bt_stripe_personal_id_type_c", "comment": null}, "bt_stripe_default_payment_gateway_c": {"type": "integer", "index": 92, "name": "bt_stripe_default_payment_gateway_c", "comment": null}, "bt_stripe_level_c": {"type": "integer", "index": 93, "name": "bt_stripe_level_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 94, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 95, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 96, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 97, "name": "lean_data_tag_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 98, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 99, "name": "do_not_route_lead_c", "comment": null}, "technical_contact_c": {"type": "integer", "index": 100, "name": "technical_contact_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 101, "name": "allbound_id_c", "comment": null}, "notes_c": {"type": "integer", "index": 102, "name": "notes_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 103, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 104, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 105, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 106, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 107, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_pushed_from_opportunity_c": {"type": "boolean", "index": 108, "name": "netsuite_conn_pushed_from_opportunity_c", "comment": null}, "description": {"type": "text", "index": 109, "name": "description", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 110, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 111, "name": "lid_linked_in_member_token_c", "comment": null}, "is_eu_resident_c": {"type": "boolean", "index": 112, "name": "is_eu_resident_c", "comment": null}, "do_not_call": {"type": "boolean", "index": 113, "name": "do_not_call", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 114, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 115, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 116, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "source_detail_c": {"type": "text", "index": 117, "name": "source_detail_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 118, "name": "utm_source_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 119, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 120, "name": "utm_term_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 121, "name": "utm_medium_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 122, "name": "utm_campaign_c", "comment": null}, "network_c": {"type": "integer", "index": 123, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 124, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 125, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 126, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 127, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 128, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 129, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 130, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 131, "name": "partner_rep_name_c", "comment": null}, "contact_type_c": {"type": "integer", "index": 132, "name": "contact_type_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 133, "name": "old_lead_source_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 134, "name": "old_lead_source_detail_c", "comment": null}, "contact_stage_c": {"type": "integer", "index": 135, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 136, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 137, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 138, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 139, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 140, "name": "original_utm_term_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 141, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 142, "name": "es_app_esecid_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 143, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 144, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 145, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 146, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 147, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 148, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 149, "name": "es_app_essource_c", "comment": null}, "individual_id": {"type": "integer", "index": 150, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 151, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 152, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 153, "name": "user_gems_has_changed_job_c", "comment": null}, "email_opt_in_explicit_c": {"type": "integer", "index": 154, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "integer", "index": 155, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "integer", "index": 156, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "integer", "index": 157, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 158, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 159, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 160, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 161, "name": "user_gems_past_title_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 162, "name": "partner_contact_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 163, "name": "promotion_id_c", "comment": null}, "referral_exists_c": {"type": "integer", "index": 164, "name": "referral_exists_c", "comment": null}, "referral_first_name_c": {"type": "integer", "index": 165, "name": "referral_first_name_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 166, "name": "referral_last_name_c", "comment": null}, "mkto_71_contact_acquisition_date_c": {"type": "integer", "index": 167, "name": "mkto_71_contact_acquisition_date_c", "comment": null}, "mkto_71_contact_acquisition_program_c": {"type": "integer", "index": 168, "name": "mkto_71_contact_acquisition_program_c", "comment": null}, "mkto_71_contact_acquisition_program_id_c": {"type": "integer", "index": 169, "name": "mkto_71_contact_acquisition_program_id_c", "comment": null}, "mkto_71_contact_inferred_city_c": {"type": "integer", "index": 170, "name": "mkto_71_contact_inferred_city_c", "comment": null}, "mkto_71_contact_inferred_company_c": {"type": "integer", "index": 171, "name": "mkto_71_contact_inferred_company_c", "comment": null}, "mkto_71_contact_inferred_country_c": {"type": "integer", "index": 172, "name": "mkto_71_contact_inferred_country_c", "comment": null}, "mkto_71_contact_inferred_metropolitan_a_c": {"type": "integer", "index": 173, "name": "mkto_71_contact_inferred_metropolitan_a_c", "comment": null}, "mkto_71_contact_inferred_phone_area_cod_c": {"type": "integer", "index": 174, "name": "mkto_71_contact_inferred_phone_area_cod_c", "comment": null}, "mkto_71_contact_inferred_postal_code_c": {"type": "integer", "index": 175, "name": "mkto_71_contact_inferred_postal_code_c", "comment": null}, "mkto_71_contact_inferred_state_region_c": {"type": "integer", "index": 176, "name": "mkto_71_contact_inferred_state_region_c", "comment": null}, "mkto_71_contact_lead_score_c": {"type": "integer", "index": 177, "name": "mkto_71_contact_lead_score_c", "comment": null}, "mkto_71_contact_original_referrer_c": {"type": "integer", "index": 178, "name": "mkto_71_contact_original_referrer_c", "comment": null}, "mkto_71_contact_original_search_engine_c": {"type": "integer", "index": 179, "name": "mkto_71_contact_original_search_engine_c", "comment": null}, "mkto_71_contact_original_search_phrase_c": {"type": "integer", "index": 180, "name": "mkto_71_contact_original_search_phrase_c", "comment": null}, "mkto_71_contact_original_source_info_c": {"type": "integer", "index": 181, "name": "mkto_71_contact_original_source_info_c", "comment": null}, "mkto_71_contact_original_source_type_c": {"type": "integer", "index": 182, "name": "mkto_71_contact_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 183, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "integer", "index": 184, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "integer", "index": 185, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "integer", "index": 186, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "integer", "index": 187, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_mkto_lead_score_c": {"type": "integer", "index": 188, "name": "mkto_si_mkto_lead_score_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 189, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 190, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 191, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ces_c": {"type": "integer", "index": 192, "name": "cloudingo_agent_ces_c", "comment": null}, "cloudingo_agent_mar_c": {"type": "integer", "index": 193, "name": "cloudingo_agent_mar_c", "comment": null}, "cloudingo_agent_mas_c": {"type": "integer", "index": 194, "name": "cloudingo_agent_mas_c", "comment": null}, "cloudingo_agent_mav_c": {"type": "integer", "index": 195, "name": "cloudingo_agent_mav_c", "comment": null}, "cloudingo_agent_mrdi_c": {"type": "integer", "index": 196, "name": "cloudingo_agent_mrdi_c", "comment": null}, "cloudingo_agent_mtz_c": {"type": "integer", "index": 197, "name": "cloudingo_agent_mtz_c", "comment": null}, "cloudingo_agent_oar_c": {"type": "integer", "index": 198, "name": "cloudingo_agent_oar_c", "comment": null}, "cloudingo_agent_oas_c": {"type": "integer", "index": 199, "name": "cloudingo_agent_oas_c", "comment": null}, "cloudingo_agent_oav_c": {"type": "integer", "index": 200, "name": "cloudingo_agent_oav_c", "comment": null}, "cloudingo_agent_ordi_c": {"type": "integer", "index": 201, "name": "cloudingo_agent_ordi_c", "comment": null}, "cloudingo_agent_otz_c": {"type": "integer", "index": 202, "name": "cloudingo_agent_otz_c", "comment": null}, "do_not_sync_marketo_c": {"type": "integer", "index": 203, "name": "do_not_sync_marketo_c", "comment": null}, "phone_extension_c": {"type": "integer", "index": 204, "name": "phone_extension_c", "comment": null}, "job_function_c": {"type": "integer", "index": 205, "name": "job_function_c", "comment": null}, "job_level_c": {"type": "integer", "index": 206, "name": "job_level_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 207, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 208, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 209, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 210, "name": "state_c", "comment": null}, "secondary_email_c": {"type": "integer", "index": 211, "name": "secondary_email_c", "comment": null}, "es_seniority_c": {"type": "integer", "index": 212, "name": "es_seniority_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 213, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 214, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 215, "name": "source_last_lead_source_detail_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 216, "name": "drift_cql_c", "comment": null}, "hot_contact_c": {"type": "integer", "index": 217, "name": "hot_contact_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 218, "name": "behavioral_score_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 219, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "integer", "index": 220, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 221, "name": "csi_code_c", "comment": null}, "clearbit_role_c": {"type": "integer", "index": 222, "name": "clearbit_role_c", "comment": null}, "clearbit_seniority_c": {"type": "integer", "index": 223, "name": "clearbit_seniority_c", "comment": null}, "clearbit_sub_role_c": {"type": "integer", "index": 224, "name": "clearbit_sub_role_c", "comment": null}, "rh_2_currency_test_c": {"type": "integer", "index": 225, "name": "rh_2_currency_test_c", "comment": null}, "rh_2_describe_c": {"type": "integer", "index": 226, "name": "rh_2_describe_c", "comment": null}, "rh_2_integer_test_c": {"type": "integer", "index": 227, "name": "rh_2_integer_test_c", "comment": null}, "created_by_role_c": {"type": "integer", "index": 228, "name": "created_by_role_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 229, "name": "demographic_score_c", "comment": null}, "country_code_c": {"type": "integer", "index": 230, "name": "country_code_c", "comment": null}, "state_code_c": {"type": "integer", "index": 231, "name": "state_code_c", "comment": null}, "attended_event_c": {"type": "integer", "index": 232, "name": "attended_event_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 233, "name": "zoominfo_technologies_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 234, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 235, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 236, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 237, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 238, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 239, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "integer", "index": 240, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 241, "name": "first_mql_date_c", "comment": null}, "active_relationship_c": {"type": "integer", "index": 242, "name": "active_relationship_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 243, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 244, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 245, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 246, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 247, "name": "clarus_status_c", "comment": null}, "historical_contact_status_c": {"type": "integer", "index": 248, "name": "historical_contact_status_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 249, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 250, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "integer", "index": 251, "name": "mql_reason_c", "comment": null}, "attempting_contact_date_time_c": {"type": "integer", "index": 252, "name": "attempting_contact_date_time_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 253, "name": "linked_in_url_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 254, "name": "trial_contact_start_date_c", "comment": null}, "contact_holdover_c": {"type": "integer", "index": 255, "name": "contact_holdover_c", "comment": null}, "bill_to_contact_hidden_c": {"type": "integer", "index": 256, "name": "bill_to_contact_hidden_c", "comment": null}, "enrichment_request_c": {"type": "integer", "index": 257, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "integer", "index": 258, "name": "meta_data_create_date_c", "comment": null}, "primary_se_c": {"type": "integer", "index": 259, "name": "primary_se_c", "comment": null}, "unqualified_reason_c": {"type": "integer", "index": 260, "name": "unqualified_reason_c", "comment": null}, "opp_handoff_ae_c": {"type": "integer", "index": 261, "name": "opp_handoff_ae_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 262, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 263, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 264, "name": "salesloft_cadence_trigger_c", "comment": null}, "last_ae_activity_owner_c": {"type": "integer", "index": 265, "name": "last_ae_activity_owner_c", "comment": null}, "last_bdr_activity_owner_c": {"type": "integer", "index": 266, "name": "last_bdr_activity_owner_c", "comment": null}, "last_manual_ae_activity_date_c": {"type": "integer", "index": 267, "name": "last_manual_ae_activity_date_c", "comment": null}, "last_manual_bdr_activity_date_c": {"type": "integer", "index": 268, "name": "last_manual_bdr_activity_date_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 269, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "integer", "index": 270, "name": "potential_fivetran_use_case_c", "comment": null}, "lean_data_router_completion_date_time_c": {"type": "integer", "index": 271, "name": "lean_data_router_completion_date_time_c", "comment": null}, "partner_territory_c": {"type": "integer", "index": 272, "name": "partner_territory_c", "comment": null}, "partner_company_c": {"type": "integer", "index": 273, "name": "partner_company_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 274, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 275, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 276, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 277, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 278, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 279, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 280, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 281, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 282, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 283, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 284, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "integer", "index": 285, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 286, "name": "sales_email_opt_out_date_time_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 287, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 288, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_net_suite_sync_error_c": {"type": "integer", "index": 289, "name": "celigo_sfnsio_net_suite_sync_error_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "integer", "index": 290, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "integer", "index": 291, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 292, "name": "ironclad_workflow_c", "comment": null}, "last_sales_activity_date_time_c": {"type": "integer", "index": 293, "name": "last_sales_activity_date_time_c", "comment": null}, "user_activity_logged_by_c": {"type": "integer", "index": 294, "name": "user_activity_logged_by_c", "comment": null}, "first_activity_after_mql_date_c": {"type": "integer", "index": 295, "name": "first_activity_after_mql_date_c", "comment": null}, "last_sdr_activity_owner_c": {"type": "integer", "index": 296, "name": "last_sdr_activity_owner_c", "comment": null}, "last_sdr_activity_date_c": {"type": "integer", "index": 297, "name": "last_sdr_activity_date_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 298, "name": "beta_connector_interest_c", "comment": null}, "first_manual_activity_after_mql_date_c": {"type": "integer", "index": 299, "name": "first_manual_activity_after_mql_date_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 300, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 301, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "integer", "index": 302, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 303, "name": "free_trial_email_confirmed_date_c", "comment": null}, "routed_from_manual_bdr_ae_activity_c": {"type": "integer", "index": 304, "name": "routed_from_manual_bdr_ae_activity_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 305, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "i_sell_avention_id_c": {"type": "integer", "index": 306, "name": "i_sell_avention_id_c", "comment": null}, "persona_c": {"type": "integer", "index": 307, "name": "persona_c", "comment": null}, "last_marketing_interesting_moment_date_c": {"type": "integer", "index": 308, "name": "last_marketing_interesting_moment_date_c", "comment": null}, "verified_c": {"type": "integer", "index": 309, "name": "verified_c", "comment": null}, "salesloft_owner_c": {"type": "integer", "index": 310, "name": "salesloft_owner_c", "comment": null}, "salesloft_owner_sf_c": {"type": "integer", "index": 311, "name": "salesloft_owner_sf_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 312, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_primary_role_c": {"type": "integer", "index": 313, "name": "pbf_startup_primary_role_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "integer", "index": 314, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 315, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 316, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 317, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 318, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 319, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 320, "name": "engagio_role_c", "comment": null}, "mql_date_changed_c": {"type": "integer", "index": 321, "name": "mql_date_changed_c", "comment": null}, "first_activity_after_mql_changed_c": {"type": "integer", "index": 322, "name": "first_activity_after_mql_changed_c", "comment": null}, "birthdate": {"type": "timestamp without time zone", "index": 323, "name": "birthdate", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 324, "name": "legacy_hvr_id_c", "comment": null}, "has_opted_out_of_fax": {"type": "integer", "index": 325, "name": "has_opted_out_of_fax", "comment": null}, "other_latitude": {"type": "integer", "index": 326, "name": "other_latitude", "comment": null}, "username_c": {"type": "integer", "index": 327, "name": "username_c", "comment": null}, "assistant_name": {"type": "integer", "index": 328, "name": "assistant_name", "comment": null}, "created_at_c": {"type": "integer", "index": 329, "name": "created_at_c", "comment": null}, "partner_contact_deprecate_c": {"type": "integer", "index": 330, "name": "partner_contact_deprecate_c", "comment": null}, "other_street": {"type": "integer", "index": 331, "name": "other_street", "comment": null}, "other_state": {"type": "integer", "index": 332, "name": "other_state", "comment": null}, "home_phone": {"type": "integer", "index": 333, "name": "home_phone", "comment": null}, "other_city": {"type": "integer", "index": 334, "name": "other_city", "comment": null}, "company_c": {"type": "integer", "index": 335, "name": "company_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 336, "name": "opportunity_c", "comment": null}, "hvr_update_c": {"type": "integer", "index": 337, "name": "hvr_update_c", "comment": null}, "other_phone": {"type": "integer", "index": 338, "name": "other_phone", "comment": null}, "other_geocode_accuracy": {"type": "integer", "index": 339, "name": "other_geocode_accuracy", "comment": null}, "other_postal_code": {"type": "integer", "index": 340, "name": "other_postal_code", "comment": null}, "other_country": {"type": "integer", "index": 341, "name": "other_country", "comment": null}, "assistant_phone": {"type": "integer", "index": 342, "name": "assistant_phone", "comment": null}, "jigsaw": {"type": "integer", "index": 343, "name": "jigsaw", "comment": null}, "avatar_c": {"type": "integer", "index": 344, "name": "avatar_c", "comment": null}, "other_longitude": {"type": "integer", "index": 345, "name": "other_longitude", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 346, "name": "lean_data_status_info_c", "comment": null}, "analytics_id_c": {"type": "integer", "index": 347, "name": "analytics_id_c", "comment": null}, "dnb_primary_address_postal_code_c": {"type": "integer", "index": 348, "name": "dnb_primary_address_postal_code_c", "comment": null}, "dnb_contact_phone_c": {"type": "integer", "index": 349, "name": "dnb_contact_phone_c", "comment": null}, "dnb_email_deliverability_score_c": {"type": "integer", "index": 350, "name": "dnb_email_deliverability_score_c", "comment": null}, "dnb_job_title_c": {"type": "integer", "index": 351, "name": "dnb_job_title_c", "comment": null}, "dnb_email_c": {"type": "integer", "index": 352, "name": "dnb_email_c", "comment": null}, "dnb_primary_address_city_c": {"type": "integer", "index": 353, "name": "dnb_primary_address_city_c", "comment": null}, "dnb_phone_accuracy_score_c": {"type": "integer", "index": 354, "name": "dnb_phone_accuracy_score_c", "comment": null}, "dnb_primary_address_state_province_c": {"type": "integer", "index": 355, "name": "dnb_primary_address_state_province_c", "comment": null}, "dnb_primary_address_state_province_abbre_c": {"type": "integer", "index": 356, "name": "dnb_primary_address_state_province_abbre_c", "comment": null}, "dnb_primary_address_country_region_code_c": {"type": "integer", "index": 357, "name": "dnb_primary_address_country_region_code_c", "comment": null}, "email_opt_in_double_c": {"type": "integer", "index": 358, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 359, "name": "phone_number_catch_all_c", "comment": null}, "contact_owners_manager_stamped_c": {"type": "integer", "index": 360, "name": "contact_owners_manager_stamped_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 361, "name": "fivetran_account_id_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 362, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 363, "name": "utm_id_c", "comment": null}, "self_service_routing_c": {"type": "integer", "index": 364, "name": "self_service_routing_c", "comment": null}, "no_geo_data_c": {"type": "integer", "index": 365, "name": "no_geo_data_c", "comment": null}, "to_be_deleted_salesloft_backfill_c": {"type": "integer", "index": 366, "name": "to_be_deleted_salesloft_backfill_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 367, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 368, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.contact"}, "source.salesforce_source.salesforce_history.contact": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 6, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 7, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 8, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 10, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 13, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 14, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 16, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 17, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 18, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 19, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 20, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 21, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 22, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 23, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 24, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 26, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 27, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 30, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 31, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 32, "name": "home_phone", "comment": null}}, "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.salesforce_source.salesforce_history.contact"}, "source.salesforce_source.salesforce.event": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "duration_in_minutes": {"type": "integer", "index": 9, "name": "duration_in_minutes", "comment": null}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": null}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": null}, "group_event_type": {"type": "integer", "index": 12, "name": "group_event_type", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 13, "name": "invitee_uuid_c", "comment": null}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": null}, "is_private": {"type": "boolean", "index": 17, "name": "is_private", "comment": null}, "is_recurrence": {"type": "boolean", "index": 18, "name": "is_recurrence", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 19, "name": "is_reminder_set", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "location": {"type": "integer", "index": 22, "name": "location", "comment": null}, "no_show_c": {"type": "boolean", "index": 23, "name": "no_show_c", "comment": null}, "owner_id": {"type": "text", "index": 24, "name": "owner_id", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 25, "name": "recurrence_activity_id", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 26, "name": "recurrence_day_of_month", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 27, "name": "recurrence_day_of_week_mask", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 28, "name": "recurrence_end_date_only", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "recurrence_interval": {"type": "integer", "index": 30, "name": "recurrence_interval", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 31, "name": "recurrence_month_of_year", "comment": null}, "recurrence_start_date_time": {"type": "timestamp without time zone", "index": 32, "name": "recurrence_start_date_time", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 33, "name": "recurrence_time_zone_sid_key", "comment": null}, "recurrence_type": {"type": "integer", "index": 34, "name": "recurrence_type", "comment": null}, "referral_account_c": {"type": "integer", "index": 35, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 36, "name": "referral_contact_c", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 37, "name": "reminder_date_time", "comment": null}, "show_as": {"type": "text", "index": 38, "name": "show_as", "comment": null}, "start_date_time": {"type": "timestamp without time zone", "index": 39, "name": "start_date_time", "comment": null}, "subject": {"type": "text", "index": 40, "name": "subject", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 41, "name": "system_modstamp", "comment": null}, "type": {"type": "text", "index": 42, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 43, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 44, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 45, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 46, "name": "who_id", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 47, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 48, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 49, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 50, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 52, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 53, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 54, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 55, "name": "lid_date_sent_c", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "is_recurrence_2": {"type": "boolean", "index": 78, "name": "is_recurrence_2", "comment": null}, "is_recurrence_2_exception": {"type": "boolean", "index": 79, "name": "is_recurrence_2_exception", "comment": null}, "is_recurrence_2_exclusion": {"type": "boolean", "index": 80, "name": "is_recurrence_2_exclusion", "comment": null}, "recurrence_2_pattern_start_date": {"type": "timestamp without time zone", "index": 81, "name": "recurrence_2_pattern_start_date", "comment": null}, "recurrence_2_pattern_text": {"type": "integer", "index": 82, "name": "recurrence_2_pattern_text", "comment": null}, "recurrence_2_pattern_time_zone": {"type": "integer", "index": 83, "name": "recurrence_2_pattern_time_zone", "comment": null}, "recurrence_2_pattern_version": {"type": "integer", "index": 84, "name": "recurrence_2_pattern_version", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 85, "name": "co_selling_activity_c", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 86, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 87, "name": "partner_contact_c", "comment": null}, "description_c": {"type": "integer", "index": 88, "name": "description_c", "comment": null}, "campaign_c": {"type": "integer", "index": 89, "name": "campaign_c", "comment": null}, "event_name_c": {"type": "integer", "index": 90, "name": "event_name_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 91, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 92, "name": "topic_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 93, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 94, "name": "partner_activity_type_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 95, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 96, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 97, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 98, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 99, "name": "vidyard_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 100, "name": "collections_hold_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 101, "name": "execute_collections_plan_activity_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 102, "name": "expected_payment_date_c", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 103, "name": "end_date", "comment": null}, "opportunity_c": {"type": "integer", "index": 104, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "integer", "index": 105, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "integer", "index": 106, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 107, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 108, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "integer", "index": 109, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "integer", "index": 110, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 111, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 112, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 113, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.event"}, "source.salesforce_source.salesforce.lead": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"country": {"type": "integer", "index": 1, "name": "country", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 2, "name": "email_bounced_reason", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 3, "name": "email_bounced_date", "comment": null}, "owner_id": {"type": "text", "index": 4, "name": "owner_id", "comment": null}, "secondary_email_c": {"type": "integer", "index": 5, "name": "secondary_email_c", "comment": null}, "lead_source": {"type": "integer", "index": 6, "name": "lead_source", "comment": null}, "converted_date": {"type": "timestamp without time zone", "index": 7, "name": "converted_date", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": null}, "master_record_id": {"type": "integer", "index": 9, "name": "master_record_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 12, "name": "geocode_accuracy", "comment": null}, "converted_contact_id": {"type": "text", "index": 13, "name": "converted_contact_id", "comment": null}, "up_region_c": {"type": "integer", "index": 14, "name": "up_region_c", "comment": null}, "id": {"type": "text", "index": 15, "name": "id", "comment": null}, "photo_url": {"type": "text", "index": 16, "name": "photo_url", "comment": null}, "state": {"type": "integer", "index": 17, "name": "state", "comment": null}, "longitude": {"type": "integer", "index": 18, "name": "longitude", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 19, "name": "last_referenced_date", "comment": null}, "up_district_c": {"type": "integer", "index": 20, "name": "up_district_c", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "country_code": {"type": "integer", "index": 22, "name": "country_code", "comment": null}, "phone": {"type": "integer", "index": 23, "name": "phone", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 24, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 26, "name": "jigsaw_contact_id", "comment": null}, "lead_source_detail_c": {"type": "integer", "index": 27, "name": "lead_source_detail_c", "comment": null}, "created_by_id": {"type": "text", "index": 28, "name": "created_by_id", "comment": null}, "salutation": {"type": "integer", "index": 29, "name": "salutation", "comment": null}, "is_converted": {"type": "boolean", "index": 30, "name": "is_converted", "comment": null}, "state_code": {"type": "integer", "index": 31, "name": "state_code", "comment": null}, "is_unread_by_owner": {"type": "boolean", "index": 32, "name": "is_unread_by_owner", "comment": null}, "status": {"type": "text", "index": 33, "name": "status", "comment": null}, "city": {"type": "integer", "index": 34, "name": "city", "comment": null}, "latitude": {"type": "integer", "index": 35, "name": "latitude", "comment": null}, "cbit_clearbit_c": {"type": "integer", "index": 36, "name": "cbit_clearbit_c", "comment": null}, "industry": {"type": "text", "index": 37, "name": "industry", "comment": null}, "title": {"type": "integer", "index": 38, "name": "title", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 39, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 40, "name": "last_viewed_date", "comment": null}, "converted_opportunity_id": {"type": "integer", "index": 41, "name": "converted_opportunity_id", "comment": null}, "is_deleted": {"type": "boolean", "index": 42, "name": "is_deleted", "comment": null}, "street": {"type": "integer", "index": 43, "name": "street", "comment": null}, "company": {"type": "text", "index": 44, "name": "company", "comment": null}, "first_name": {"type": "text", "index": 45, "name": "first_name", "comment": null}, "email": {"type": "text", "index": 46, "name": "email", "comment": null}, "website": {"type": "integer", "index": 47, "name": "website", "comment": null}, "last_name": {"type": "text", "index": 48, "name": "last_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 49, "name": "number_of_employees", "comment": null}, "up_territory_c": {"type": "integer", "index": 50, "name": "up_territory_c", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 51, "name": "created_date", "comment": null}, "gclid_c": {"type": "integer", "index": 52, "name": "gclid_c", "comment": null}, "active_in_sequence_c": {"type": "boolean", "index": 53, "name": "active_in_sequence_c", "comment": null}, "postal_code": {"type": "integer", "index": 54, "name": "postal_code", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 55, "name": "cbit_clearbit_ready_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 56, "name": "has_opted_out_of_email", "comment": null}, "converted_account_id": {"type": "text", "index": 57, "name": "converted_account_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 58, "name": "mobile_phone", "comment": null}, "calendly_created_c": {"type": "integer", "index": 59, "name": "calendly_created_c", "comment": null}, "account_c": {"type": "integer", "index": 60, "name": "account_c", "comment": null}, "all_connectors_c": {"type": "integer", "index": 61, "name": "all_connectors_c", "comment": null}, "all_data_warehouses_c": {"type": "integer", "index": 62, "name": "all_data_warehouses_c", "comment": null}, "bi_tools_c": {"type": "integer", "index": 63, "name": "bi_tools_c", "comment": null}, "competitors_c": {"type": "integer", "index": 64, "name": "competitors_c", "comment": null}, "annual_revenue": {"type": "integer", "index": 65, "name": "annual_revenue", "comment": null}, "connectors_products_c": {"type": "integer", "index": 66, "name": "connectors_products_c", "comment": null}, "contact_c": {"type": "integer", "index": 67, "name": "contact_c", "comment": null}, "data_warehouse_products_c": {"type": "integer", "index": 68, "name": "data_warehouse_products_c", "comment": null}, "notes_c": {"type": "integer", "index": 69, "name": "notes_c", "comment": null}, "timeframe_c": {"type": "integer", "index": 70, "name": "timeframe_c", "comment": null}, "account_all_products_c": {"type": "integer", "index": 71, "name": "account_all_products_c", "comment": null}, "account_bi_tools_c": {"type": "integer", "index": 72, "name": "account_bi_tools_c", "comment": null}, "account_data_warehouses_c": {"type": "integer", "index": 73, "name": "account_data_warehouses_c", "comment": null}, "opportunity_competitors_c": {"type": "integer", "index": 74, "name": "opportunity_competitors_c", "comment": null}, "opportunity_products_c": {"type": "integer", "index": 75, "name": "opportunity_products_c", "comment": null}, "description": {"type": "integer", "index": 76, "name": "description", "comment": null}, "referral_account_c": {"type": "integer", "index": 77, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 78, "name": "referral_contact_c", "comment": null}, "volume_in_millions_c": {"type": "integer", "index": 79, "name": "volume_in_millions_c", "comment": null}, "feature_requests_c": {"type": "integer", "index": 80, "name": "feature_requests_c", "comment": null}, "lead_number_c": {"type": "integer", "index": 81, "name": "lead_number_c", "comment": null}, "demo_scheduled_by_calenderly_c": {"type": "boolean", "index": 82, "name": "demo_scheduled_by_calenderly_c", "comment": null}, "to_delete_c": {"type": "boolean", "index": 83, "name": "to_delete_c", "comment": null}, "bounced_email_c": {"type": "integer", "index": 84, "name": "bounced_email_c", "comment": null}, "email_quality_c": {"type": "boolean", "index": 85, "name": "email_quality_c", "comment": null}, "email_quality_catchall_c": {"type": "integer", "index": 86, "name": "email_quality_catchall_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 87, "name": "old_lead_source_c", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 88, "name": "email_bounced_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 89, "name": "old_lead_source_detail_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 90, "name": "utm_medium_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 91, "name": "utm_source_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 92, "name": "utm_campaign_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 93, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 94, "name": "utm_term_c", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 95, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 96, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 97, "name": "fivetran_user_id_c", "comment": null}, "geo_state_acton_c": {"type": "integer", "index": 98, "name": "geo_state_acton_c", "comment": null}, "actoncountry_c": {"type": "integer", "index": 99, "name": "actoncountry_c", "comment": null}, "actoncity_c": {"type": "integer", "index": 100, "name": "actoncity_c", "comment": null}, "actoncountrycode_c": {"type": "integer", "index": 101, "name": "actoncountrycode_c", "comment": null}, "actonpostalcode_c": {"type": "integer", "index": 102, "name": "actonpostalcode_c", "comment": null}, "actonreferrer_c": {"type": "integer", "index": 103, "name": "actonreferrer_c", "comment": null}, "actonstate_c": {"type": "integer", "index": 104, "name": "actonstate_c", "comment": null}, "geo_city_c": {"type": "integer", "index": 105, "name": "geo_city_c", "comment": null}, "geo_country_c": {"type": "integer", "index": 106, "name": "geo_country_c", "comment": null}, "geo_country_code_c": {"type": "integer", "index": 107, "name": "geo_country_code_c", "comment": null}, "geo_postal_code_c": {"type": "integer", "index": 108, "name": "geo_postal_code_c", "comment": null}, "geo_state_c": {"type": "integer", "index": 109, "name": "geo_state_c", "comment": null}, "company_type_c": {"type": "integer", "index": 110, "name": "company_type_c", "comment": null}, "pi_campaign_c": {"type": "integer", "index": 111, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 112, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 113, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 114, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 115, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "integer", "index": 116, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 117, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 118, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 119, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 120, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 121, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 122, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "integer", "index": 123, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 124, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "integer", "index": 125, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 126, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 127, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "integer", "index": 128, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 129, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 130, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 131, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 132, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 133, "name": "pi_utm_term_c", "comment": null}, "fax": {"type": "integer", "index": 134, "name": "fax", "comment": null}, "region_c": {"type": "integer", "index": 135, "name": "region_c", "comment": null}, "competitor_c": {"type": "boolean", "index": 136, "name": "competitor_c", "comment": null}, "source_detail_c": {"type": "integer", "index": 137, "name": "source_detail_c", "comment": null}, "fivetran_account_stage_c": {"type": "integer", "index": 138, "name": "fivetran_account_stage_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 139, "name": "fivetran_account_id_c", "comment": null}, "lean_data_router_status_c": {"type": "integer", "index": 140, "name": "lean_data_router_status_c", "comment": null}, "lean_data_matched_lead_c": {"type": "integer", "index": 141, "name": "lean_data_matched_lead_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 142, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_search_index_c": {"type": "text", "index": 143, "name": "lean_data_search_index_c", "comment": null}, "lean_data_reporting_matched_account_c": {"type": "text", "index": 144, "name": "lean_data_reporting_matched_account_c", "comment": null}, "lean_data_reporting_timestamp_c": {"type": "timestamp without time zone", "index": 145, "name": "lean_data_reporting_timestamp_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 146, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_marketing_sys_created_date_c": {"type": "integer", "index": 147, "name": "lean_data_marketing_sys_created_date_c", "comment": null}, "lean_data_matched_account_c": {"type": "integer", "index": 148, "name": "lean_data_matched_account_c", "comment": null}, "lean_data_a_2_b_account_c": {"type": "integer", "index": 149, "name": "lean_data_a_2_b_account_c", "comment": null}, "lean_data_search_c": {"type": "integer", "index": 150, "name": "lean_data_search_c", "comment": null}, "lean_data_routing_status_c": {"type": "text", "index": 151, "name": "lean_data_routing_status_c", "comment": null}, "lean_data_a_2_b_group_c": {"type": "integer", "index": 152, "name": "lean_data_a_2_b_group_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 153, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 154, "name": "lean_data_tag_c", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 155, "name": "lean_data_status_info_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 156, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 157, "name": "do_not_route_lead_c", "comment": null}, "partner_type_c": {"type": "integer", "index": 158, "name": "partner_type_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 159, "name": "allbound_id_c", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 160, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 161, "name": "lid_linked_in_member_token_c", "comment": null}, "lean_data_re_route_c": {"type": "integer", "index": 162, "name": "lean_data_re_route_c", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 163, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 164, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 165, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "network_c": {"type": "integer", "index": 166, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 167, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 168, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 169, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 170, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 171, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 172, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 173, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 174, "name": "partner_rep_name_c", "comment": null}, "lead_type_c": {"type": "integer", "index": 175, "name": "lead_type_c", "comment": null}, "contact_stage_c": {"type": "text", "index": 176, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 177, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 178, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 179, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 180, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 181, "name": "original_utm_term_c", "comment": null}, "es_app_esalexa_rank_c": {"type": "integer", "index": 182, "name": "es_app_esalexa_rank_c", "comment": null}, "es_app_esaudience_names_c": {"type": "integer", "index": 183, "name": "es_app_esaudience_names_c", "comment": null}, "es_app_escity_c": {"type": "integer", "index": 184, "name": "es_app_escity_c", "comment": null}, "es_app_escompany_phone_c": {"type": "integer", "index": 185, "name": "es_app_escompany_phone_c", "comment": null}, "es_app_escountry_c": {"type": "integer", "index": 186, "name": "es_app_escountry_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 187, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 188, "name": "es_app_esecid_c", "comment": null}, "es_app_esemployees_c": {"type": "integer", "index": 189, "name": "es_app_esemployees_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 190, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 191, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esfacebook_c": {"type": "integer", "index": 192, "name": "es_app_esfacebook_c", "comment": null}, "es_app_esindustry_c": {"type": "integer", "index": 193, "name": "es_app_esindustry_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 194, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 195, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 196, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_eskeywords_c": {"type": "integer", "index": 197, "name": "es_app_eskeywords_c", "comment": null}, "es_app_eslinked_in_c": {"type": "integer", "index": 198, "name": "es_app_eslinked_in_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 199, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_esrevenue_c": {"type": "integer", "index": 200, "name": "es_app_esrevenue_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 201, "name": "es_app_essource_c", "comment": null}, "es_app_esstate_c": {"type": "integer", "index": 202, "name": "es_app_esstate_c", "comment": null}, "es_app_esstreet_c": {"type": "integer", "index": 203, "name": "es_app_esstreet_c", "comment": null}, "es_app_estechnologies_c": {"type": "integer", "index": 204, "name": "es_app_estechnologies_c", "comment": null}, "es_app_estwitter_c": {"type": "integer", "index": 205, "name": "es_app_estwitter_c", "comment": null}, "es_app_eszipcode_c": {"type": "integer", "index": 206, "name": "es_app_eszipcode_c", "comment": null}, "marketing_prospect_routing_rules_c": {"type": "boolean", "index": 207, "name": "marketing_prospect_routing_rules_c", "comment": null}, "individual_id": {"type": "integer", "index": 208, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 209, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 210, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 211, "name": "user_gems_has_changed_job_c", "comment": null}, "user_gems_linked_in_c": {"type": "integer", "index": 212, "name": "user_gems_linked_in_c", "comment": null}, "email_opt_in_c": {"type": "integer", "index": 213, "name": "email_opt_in_c", "comment": null}, "email_opt_in_explicit_c": {"type": "boolean", "index": 214, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "boolean", "index": 215, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "boolean", "index": 216, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "boolean", "index": 217, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 218, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 219, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 220, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 221, "name": "user_gems_past_title_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 222, "name": "promotion_id_c", "comment": null}, "previous_customer_c": {"type": "integer", "index": 223, "name": "previous_customer_c", "comment": null}, "referral_contact_email_c": {"type": "integer", "index": 224, "name": "referral_contact_email_c", "comment": null}, "referral_firstname_c": {"type": "integer", "index": 225, "name": "referral_firstname_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 226, "name": "referral_last_name_c", "comment": null}, "mkto_71_lead_score_c": {"type": "integer", "index": 227, "name": "mkto_71_lead_score_c", "comment": null}, "mkto_71_acquisition_date_c": {"type": "integer", "index": 228, "name": "mkto_71_acquisition_date_c", "comment": null}, "mkto_71_acquisition_program_id_c": {"type": "integer", "index": 229, "name": "mkto_71_acquisition_program_id_c", "comment": null}, "mkto_acquisition_program_c": {"type": "integer", "index": 230, "name": "mkto_acquisition_program_c", "comment": null}, "mkto_71_inferred_city_c": {"type": "integer", "index": 231, "name": "mkto_71_inferred_city_c", "comment": null}, "mkto_71_inferred_company_c": {"type": "integer", "index": 232, "name": "mkto_71_inferred_company_c", "comment": null}, "mkto_71_inferred_country_c": {"type": "integer", "index": 233, "name": "mkto_71_inferred_country_c", "comment": null}, "mkto_71_inferred_metropolitan_area_c": {"type": "integer", "index": 234, "name": "mkto_71_inferred_metropolitan_area_c", "comment": null}, "mkto_71_inferred_phone_area_code_c": {"type": "integer", "index": 235, "name": "mkto_71_inferred_phone_area_code_c", "comment": null}, "mkto_71_inferred_postal_code_c": {"type": "integer", "index": 236, "name": "mkto_71_inferred_postal_code_c", "comment": null}, "mkto_71_inferred_state_region_c": {"type": "integer", "index": 237, "name": "mkto_71_inferred_state_region_c", "comment": null}, "mkto_71_original_referrer_c": {"type": "integer", "index": 238, "name": "mkto_71_original_referrer_c", "comment": null}, "mkto_71_original_search_engine_c": {"type": "integer", "index": 239, "name": "mkto_71_original_search_engine_c", "comment": null}, "mkto_71_original_search_phrase_c": {"type": "integer", "index": 240, "name": "mkto_71_original_search_phrase_c", "comment": null}, "mkto_71_original_source_info_c": {"type": "integer", "index": 241, "name": "mkto_71_original_source_info_c", "comment": null}, "mkto_71_original_source_type_c": {"type": "integer", "index": 242, "name": "mkto_71_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 243, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "timestamp without time zone", "index": 244, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "text", "index": 245, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "text", "index": 246, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "text", "index": 247, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_msicontact_id_c": {"type": "integer", "index": 248, "name": "mkto_si_msicontact_id_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 249, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 250, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 251, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ar_c": {"type": "integer", "index": 252, "name": "cloudingo_agent_ar_c", "comment": null}, "cloudingo_agent_ardi_c": {"type": "integer", "index": 253, "name": "cloudingo_agent_ardi_c", "comment": null}, "cloudingo_agent_as_c": {"type": "integer", "index": 254, "name": "cloudingo_agent_as_c", "comment": null}, "cloudingo_agent_atz_c": {"type": "integer", "index": 255, "name": "cloudingo_agent_atz_c", "comment": null}, "cloudingo_agent_av_c": {"type": "integer", "index": 256, "name": "cloudingo_agent_av_c", "comment": null}, "cloudingo_agent_les_c": {"type": "integer", "index": 257, "name": "cloudingo_agent_les_c", "comment": null}, "do_not_sync_marketo_c": {"type": "boolean", "index": 258, "name": "do_not_sync_marketo_c", "comment": null}, "source_every_utm_campaign_c": {"type": "integer", "index": 259, "name": "source_every_utm_campaign_c", "comment": null}, "source_every_utm_content_c": {"type": "integer", "index": 260, "name": "source_every_utm_content_c", "comment": null}, "source_every_utm_medium_c": {"type": "integer", "index": 261, "name": "source_every_utm_medium_c", "comment": null}, "source_every_utm_source_c": {"type": "integer", "index": 262, "name": "source_every_utm_source_c", "comment": null}, "source_every_utm_term_c": {"type": "integer", "index": 263, "name": "source_every_utm_term_c", "comment": null}, "source_first_utm_campaign_c": {"type": "integer", "index": 264, "name": "source_first_utm_campaign_c", "comment": null}, "source_first_utm_content_c": {"type": "integer", "index": 265, "name": "source_first_utm_content_c", "comment": null}, "source_first_utm_medium_c": {"type": "integer", "index": 266, "name": "source_first_utm_medium_c", "comment": null}, "source_first_utm_source_c": {"type": "integer", "index": 267, "name": "source_first_utm_source_c", "comment": null}, "source_first_utm_term_c": {"type": "integer", "index": 268, "name": "source_first_utm_term_c", "comment": null}, "source_last_utm_campaign_c": {"type": "text", "index": 269, "name": "source_last_utm_campaign_c", "comment": null}, "source_last_utm_content_c": {"type": "text", "index": 270, "name": "source_last_utm_content_c", "comment": null}, "source_last_utm_medium_c": {"type": "text", "index": 271, "name": "source_last_utm_medium_c", "comment": null}, "source_last_utm_source_c": {"type": "text", "index": 272, "name": "source_last_utm_source_c", "comment": null}, "source_last_utm_term_c": {"type": "text", "index": 273, "name": "source_last_utm_term_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 274, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 275, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 276, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 277, "name": "state_c", "comment": null}, "source_first_lead_source_category_c": {"type": "integer", "index": 278, "name": "source_first_lead_source_category_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 279, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 280, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 281, "name": "source_last_lead_source_detail_c", "comment": null}, "source_every_lead_source_c": {"type": "integer", "index": 282, "name": "source_every_lead_source_c", "comment": null}, "source_every_lead_source_category_c": {"type": "integer", "index": 283, "name": "source_every_lead_source_category_c", "comment": null}, "source_every_lead_source_detail_c": {"type": "integer", "index": 284, "name": "source_every_lead_source_detail_c", "comment": null}, "source_first_lead_source_c": {"type": "integer", "index": 285, "name": "source_first_lead_source_c", "comment": null}, "source_first_lead_source_detail_c": {"type": "integer", "index": 286, "name": "source_first_lead_source_detail_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 287, "name": "behavioral_score_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 288, "name": "demographic_score_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 289, "name": "drift_cql_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 290, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "boolean", "index": 291, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 292, "name": "csi_code_c", "comment": null}, "csi_description_c": {"type": "text", "index": 293, "name": "csi_description_c", "comment": null}, "converted_date_time_c": {"type": "timestamp without time zone", "index": 294, "name": "converted_date_time_c", "comment": null}, "lead_created_date_time_reporting_c": {"type": "timestamp without time zone", "index": 295, "name": "lead_created_date_time_reporting_c", "comment": null}, "lead_iq_country_c": {"type": "integer", "index": 296, "name": "lead_iq_country_c", "comment": null}, "lead_iq_employee_count_c": {"type": "integer", "index": 297, "name": "lead_iq_employee_count_c", "comment": null}, "lead_iq_employee_range_c": {"type": "integer", "index": 298, "name": "lead_iq_employee_range_c", "comment": null}, "lead_iq_state_c": {"type": "integer", "index": 299, "name": "lead_iq_state_c", "comment": null}, "lead_iq_zip_code_c": {"type": "integer", "index": 300, "name": "lead_iq_zip_code_c", "comment": null}, "zoominfo_country_c": {"type": "integer", "index": 301, "name": "zoominfo_country_c", "comment": null}, "zoominfo_employee_count_c": {"type": "integer", "index": 302, "name": "zoominfo_employee_count_c", "comment": null}, "zoominfo_state_c": {"type": "integer", "index": 303, "name": "zoominfo_state_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 304, "name": "zoominfo_technologies_c", "comment": null}, "zoominfo_zip_code_c": {"type": "integer", "index": 305, "name": "zoominfo_zip_code_c", "comment": null}, "attended_event_c": {"type": "boolean", "index": 306, "name": "attended_event_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 307, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 308, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 309, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 310, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 311, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 312, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "boolean", "index": 313, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 314, "name": "first_mql_date_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 315, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 316, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "text", "index": 317, "name": "mql_reason_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 318, "name": "trial_contact_start_date_c", "comment": null}, "enrichment_request_c": {"type": "boolean", "index": 319, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "timestamp without time zone", "index": 320, "name": "meta_data_create_date_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 321, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 322, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 323, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 324, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 325, "name": "clarus_status_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 326, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 327, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 328, "name": "salesloft_cadence_trigger_c", "comment": null}, "datawarehouse_used_c": {"type": "integer", "index": 329, "name": "datawarehouse_used_c", "comment": null}, "contact_status_c": {"type": "integer", "index": 330, "name": "contact_status_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 331, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "text", "index": 332, "name": "potential_fivetran_use_case_c", "comment": null}, "bizible_2_account_c": {"type": "integer", "index": 333, "name": "bizible_2_account_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 334, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 335, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 336, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 337, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 338, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 339, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 340, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 341, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 342, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 343, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 344, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "boolean", "index": 345, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 346, "name": "sales_email_opt_out_date_time_c", "comment": null}, "bombora_app_bombora_surge_record_count_c": {"type": "integer", "index": 347, "name": "bombora_app_bombora_surge_record_count_c", "comment": null}, "bombora_app_bombora_last_date_time_updated_c": {"type": "integer", "index": 348, "name": "bombora_app_bombora_last_date_time_updated_c", "comment": null}, "bombora_app_bombora_total_composite_score_c": {"type": "integer", "index": 349, "name": "bombora_app_bombora_total_composite_score_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 350, "name": "linked_in_url_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 351, "name": "beta_connector_interest_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 352, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 353, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "boolean", "index": 354, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 355, "name": "free_trial_email_confirmed_date_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 356, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "dnboptimizer_dn_bcompany_record_c": {"type": "integer", "index": 357, "name": "dnboptimizer_dn_bcompany_record_c", "comment": null}, "dnboptimizer_dnb_d_u_n_s_number_c": {"type": "integer", "index": 358, "name": "dnboptimizer_dnb_d_u_n_s_number_c", "comment": null}, "i_sell_oskey_id_c": {"type": "integer", "index": 359, "name": "i_sell_oskey_id_c", "comment": null}, "verified_c": {"type": "boolean", "index": 360, "name": "verified_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 361, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_c": {"type": "integer", "index": 362, "name": "pbf_startup_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "boolean", "index": 363, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 364, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 365, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 366, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_matched_account_c": {"type": "integer", "index": 367, "name": "engagio_matched_account_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 368, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_match_time_c": {"type": "integer", "index": 369, "name": "engagio_match_time_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 370, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 371, "name": "engagio_role_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 372, "name": "legacy_hvr_id_c", "comment": null}, "hvr_channel_c": {"type": "integer", "index": 373, "name": "hvr_channel_c", "comment": null}, "email_opt_in_double_c": {"type": "boolean", "index": 374, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 375, "name": "phone_number_catch_all_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 376, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 377, "name": "utm_id_c", "comment": null}, "source_every_utm_id_c": {"type": "integer", "index": 378, "name": "source_every_utm_id_c", "comment": null}, "source_last_utm_id_c": {"type": "integer", "index": 379, "name": "source_last_utm_id_c", "comment": null}, "source_first_utm_id_c": {"type": "integer", "index": 380, "name": "source_first_utm_id_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 381, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 382, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.lead"}, "source.salesforce_source.salesforce.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 7, "name": "description", "comment": null}, "expected_revenue": {"type": "integer", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_excluded_from_territory_2_filter": {"type": "integer", "index": 20, "name": "is_excluded_from_territory_2_filter", "comment": null}, "is_won": {"type": "boolean", "index": 21, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 22, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 25, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 27, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 29, "name": "pricebook_2_id", "comment": null}, "probability": {"type": "double precision", "index": 30, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 32, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 33, "name": "synced_quote_id", "comment": null}, "territory_2_id": {"type": "integer", "index": 34, "name": "territory_2_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 36, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.opportunity"}, "source.salesforce_source.salesforce_history.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 5, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 6, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 7, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 8, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 9, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 10, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 11, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 12, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 13, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 14, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 15, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 16, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 17, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 18, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 19, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 21, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 22, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 23, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 24, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 25, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 26, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 27, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 29, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 30, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 31, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 32, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 33, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 34, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}}, "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.salesforce_source.salesforce_history.opportunity"}, "source.salesforce_source.salesforce.opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"product_2_id": {"type": "text", "index": 1, "name": "product_2_id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "total_price": {"type": "double precision", "index": 3, "name": "total_price", "comment": null}, "description": {"type": "integer", "index": 4, "name": "description", "comment": null}, "discount": {"type": "integer", "index": 5, "name": "discount", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 6, "name": "last_modified_date", "comment": null}, "list_price": {"type": "integer", "index": 7, "name": "list_price", "comment": null}, "product_code": {"type": "text", "index": 8, "name": "product_code", "comment": null}, "unit_price": {"type": "double precision", "index": 9, "name": "unit_price", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "opportunity_id": {"type": "text", "index": 12, "name": "opportunity_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 14, "name": "service_date", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 15, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 16, "name": "name", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "sort_order": {"type": "integer", "index": 20, "name": "sort_order", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 21, "name": "pricebook_entry_id", "comment": null}, "one_saas_app_included_c": {"type": "integer", "index": 22, "name": "one_saas_app_included_c", "comment": null}, "one_saas_app_quantity_invoiced_c": {"type": "integer", "index": 23, "name": "one_saas_app_quantity_invoiced_c", "comment": null}, "one_saas_app_quantity_not_invoiced_c": {"type": "integer", "index": 24, "name": "one_saas_app_quantity_not_invoiced_c", "comment": null}, "has_quantity_schedule": {"type": "integer", "index": 25, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "integer", "index": 26, "name": "has_revenue_schedule", "comment": null}, "has_schedule": {"type": "integer", "index": 27, "name": "has_schedule", "comment": null}, "event_volume_c": {"type": "integer", "index": 28, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 29, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 30, "name": "row_volume_c", "comment": null}, "months_c": {"type": "integer", "index": 31, "name": "months_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 32, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_discount_item_c": {"type": "integer", "index": 33, "name": "netsuite_conn_discount_item_c", "comment": null}, "netsuite_conn_user_entered_sales_price_c": {"type": "integer", "index": 34, "name": "netsuite_conn_user_entered_sales_price_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 35, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_terms_c": {"type": "integer", "index": 36, "name": "netsuite_conn_terms_c", "comment": null}, "netsuite_conn_net_suite_item_key_id_c": {"type": "integer", "index": 37, "name": "netsuite_conn_net_suite_item_key_id_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 38, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_end_date_c": {"type": "integer", "index": 39, "name": "netsuite_conn_end_date_c", "comment": null}, "netsuite_conn_list_rate_c": {"type": "integer", "index": 40, "name": "netsuite_conn_list_rate_c", "comment": null}, "netsuite_conn_from_contract_item_id_c": {"type": "integer", "index": 41, "name": "netsuite_conn_from_contract_item_id_c", "comment": null}, "netsuite_conn_start_date_c": {"type": "integer", "index": 42, "name": "netsuite_conn_start_date_c", "comment": null}, "netsuite_conn_net_suite_item_id_import_c": {"type": "integer", "index": 43, "name": "netsuite_conn_net_suite_item_id_import_c", "comment": null}, "sbqq_parent_id_c": {"type": "text", "index": 44, "name": "sbqq_parent_id_c", "comment": null}, "sbqq_quote_line_c": {"type": "text", "index": 45, "name": "sbqq_quote_line_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 46, "name": "sbqq_subscription_type_c", "comment": null}, "product_family_c": {"type": "text", "index": 47, "name": "product_family_c", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 48, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 49, "name": "last_viewed_date", "comment": null}, "celigo_sfnsio_contract_item_id_c": {"type": "integer", "index": 50, "name": "celigo_sfnsio_contract_item_id_c", "comment": null}, "celigo_sfnsio_contract_term_c": {"type": "integer", "index": 51, "name": "celigo_sfnsio_contract_term_c", "comment": null}, "celigo_sfnsio_end_date_c": {"type": "integer", "index": 52, "name": "celigo_sfnsio_end_date_c", "comment": null}, "celigo_sfnsio_list_rate_c": {"type": "integer", "index": 53, "name": "celigo_sfnsio_list_rate_c", "comment": null}, "celigo_sfnsio_net_suite_line_id_c": {"type": "integer", "index": 54, "name": "celigo_sfnsio_net_suite_line_id_c", "comment": null}, "celigo_sfnsio_start_date_c": {"type": "integer", "index": 55, "name": "celigo_sfnsio_start_date_c", "comment": null}, "product_code_stamped_c": {"type": "integer", "index": 56, "name": "product_code_stamped_c", "comment": null}, "hvr_use_case_c": {"type": "boolean", "index": 57, "name": "hvr_use_case_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 58, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.opportunity_line_item"}, "source.salesforce_source.salesforce.order": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": null}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": null}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "integer", "index": 8, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 9, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "integer", "index": 10, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "integer", "index": 11, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 12, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 13, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "integer", "index": 14, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": null}, "company_authorized_by_id": {"type": "integer", "index": 16, "name": "company_authorized_by_id", "comment": null}, "contract_id": {"type": "integer", "index": 17, "name": "contract_id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "customer_authorized_by_id": {"type": "integer", "index": 20, "name": "customer_authorized_by_id", "comment": null}, "description": {"type": "integer", "index": 21, "name": "description", "comment": null}, "effective_date": {"type": "timestamp without time zone", "index": 22, "name": "effective_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 23, "name": "end_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": null}, "is_reduction_order": {"type": "boolean", "index": 25, "name": "is_reduction_order", "comment": null}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 28, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 29, "name": "last_viewed_date", "comment": null}, "order_number": {"type": "integer", "index": 30, "name": "order_number", "comment": null}, "original_order_id": {"type": "integer", "index": 31, "name": "original_order_id", "comment": null}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 33, "name": "pricebook_2_id", "comment": null}, "shipping_city": {"type": "text", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "integer", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "integer", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "integer", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 43, "name": "shipping_street", "comment": null}, "status": {"type": "text", "index": 44, "name": "status", "comment": null}, "status_code": {"type": "text", "index": 45, "name": "status_code", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 46, "name": "system_modstamp", "comment": null}, "total_amount": {"type": "double precision", "index": 47, "name": "total_amount", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 49, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_opportunity_c": {"type": "integer", "index": 53, "name": "netsuite_conn_opportunity_c", "comment": null}, "netsuite_conn_net_suite_order_status_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_order_status_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 55, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_tax_total_c": {"type": "integer", "index": 56, "name": "netsuite_conn_tax_total_c", "comment": null}, "netsuite_conn_tracking_numbers_c": {"type": "integer", "index": 57, "name": "netsuite_conn_tracking_numbers_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 58, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_document_id_c": {"type": "integer", "index": 59, "name": "netsuite_conn_document_id_c", "comment": null}, "netsuite_conn_subtotal_c": {"type": "integer", "index": 60, "name": "netsuite_conn_subtotal_c", "comment": null}, "netsuite_conn_discount_total_c": {"type": "integer", "index": 61, "name": "netsuite_conn_discount_total_c", "comment": null}, "netsuite_conn_total_c": {"type": "integer", "index": 62, "name": "netsuite_conn_total_c", "comment": null}, "netsuite_conn_net_suite_order_date_c": {"type": "timestamp without time zone", "index": 63, "name": "netsuite_conn_net_suite_order_date_c", "comment": null}, "netsuite_conn_ship_date_c": {"type": "integer", "index": 64, "name": "netsuite_conn_ship_date_c", "comment": null}, "netsuite_conn_quote_c": {"type": "integer", "index": 65, "name": "netsuite_conn_quote_c", "comment": null}, "netsuite_conn_net_suite_order_number_c": {"type": "text", "index": 66, "name": "netsuite_conn_net_suite_order_number_c", "comment": null}, "sbqq_contracted_c": {"type": "boolean", "index": 67, "name": "sbqq_contracted_c", "comment": null}, "sbqq_contracting_method_c": {"type": "text", "index": 68, "name": "sbqq_contracting_method_c", "comment": null}, "sbqq_payment_term_c": {"type": "text", "index": 69, "name": "sbqq_payment_term_c", "comment": null}, "sbqq_price_calc_status_c": {"type": "text", "index": 70, "name": "sbqq_price_calc_status_c", "comment": null}, "sbqq_price_calc_status_message_c": {"type": "integer", "index": 71, "name": "sbqq_price_calc_status_message_c", "comment": null}, "sbqq_quote_c": {"type": "text", "index": 72, "name": "sbqq_quote_c", "comment": null}, "sbqq_renewal_term_c": {"type": "integer", "index": 73, "name": "sbqq_renewal_term_c", "comment": null}, "sbqq_renewal_uplift_rate_c": {"type": "integer", "index": 74, "name": "sbqq_renewal_uplift_rate_c", "comment": null}, "ava_sfcpq_ava_tax_message_c": {"type": "text", "index": 75, "name": "ava_sfcpq_ava_tax_message_c", "comment": null}, "ava_sfcpq_entity_use_code_c": {"type": "integer", "index": 76, "name": "ava_sfcpq_entity_use_code_c", "comment": null}, "ava_sfcpq_invoice_message_c": {"type": "integer", "index": 77, "name": "ava_sfcpq_invoice_message_c", "comment": null}, "ava_sfcpq_is_seller_importer_of_record_c": {"type": "boolean", "index": 78, "name": "ava_sfcpq_is_seller_importer_of_record_c", "comment": null}, "ava_sfcpq_order_calculate_tax_c": {"type": "boolean", "index": 79, "name": "ava_sfcpq_order_calculate_tax_c", "comment": null}, "ava_sfcpq_sales_tax_amount_c": {"type": "integer", "index": 80, "name": "ava_sfcpq_sales_tax_amount_c", "comment": null}, "blng_bill_now_c": {"type": "boolean", "index": 81, "name": "blng_bill_now_c", "comment": null}, "blng_billing_account_c": {"type": "text", "index": 82, "name": "blng_billing_account_c", "comment": null}, "blng_billing_day_of_month_c": {"type": "integer", "index": 83, "name": "blng_billing_day_of_month_c", "comment": null}, "blng_invoice_batch_c": {"type": "text", "index": 84, "name": "blng_invoice_batch_c", "comment": null}, "amendment_type_c": {"type": "integer", "index": 85, "name": "amendment_type_c", "comment": null}, "credit_summary_c": {"type": "text", "index": 86, "name": "credit_summary_c", "comment": null}, "evergreen_c": {"type": "boolean", "index": 87, "name": "evergreen_c", "comment": null}, "invoicing_type_c": {"type": "text", "index": 88, "name": "invoicing_type_c", "comment": null}, "legal_entity_c": {"type": "text", "index": 89, "name": "legal_entity_c", "comment": null}, "prepaid_billing_frequency_c": {"type": "text", "index": 90, "name": "prepaid_billing_frequency_c", "comment": null}, "prepaid_order_c": {"type": "boolean", "index": 91, "name": "prepaid_order_c", "comment": null}, "update_subscriptions_only_c": {"type": "boolean", "index": 92, "name": "update_subscriptions_only_c", "comment": null}, "order_auto_activated_c": {"type": "boolean", "index": 93, "name": "order_auto_activated_c", "comment": null}, "synced_to_net_suite_c": {"type": "boolean", "index": 94, "name": "synced_to_net_suite_c", "comment": null}, "purchase_order_number_c": {"type": "integer", "index": 95, "name": "purchase_order_number_c", "comment": null}, "celigo_sfnsio_discount_total_net_suite_c": {"type": "integer", "index": 96, "name": "celigo_sfnsio_discount_total_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 97, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_order_number_c": {"type": "text", "index": 98, "name": "celigo_sfnsio_net_suite_order_number_c", "comment": null}, "celigo_sfnsio_net_suite_order_status_c": {"type": "integer", "index": 99, "name": "celigo_sfnsio_net_suite_order_status_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "text", "index": 100, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_ship_date_c": {"type": "integer", "index": 101, "name": "celigo_sfnsio_ship_date_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 102, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_sub_total_net_suite_c": {"type": "integer", "index": 103, "name": "celigo_sfnsio_sub_total_net_suite_c", "comment": null}, "celigo_sfnsio_tax_total_net_suite_c": {"type": "integer", "index": 104, "name": "celigo_sfnsio_tax_total_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 105, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_total_net_suite_c": {"type": "integer", "index": 106, "name": "celigo_sfnsio_total_net_suite_c", "comment": null}, "amend_with_rollover_spend_type_c": {"type": "boolean", "index": 107, "name": "amend_with_rollover_spend_type_c", "comment": null}, "customer_spend_type_c": {"type": "integer", "index": 108, "name": "customer_spend_type_c", "comment": null}, "order_spend_type_c": {"type": "integer", "index": 109, "name": "order_spend_type_c", "comment": null}, "opportunity_id": {"type": "integer", "index": 110, "name": "opportunity_id", "comment": null}, "purchase_summary_c": {"type": "integer", "index": 111, "name": "purchase_summary_c", "comment": null}, "is_hvr_legacy_order_c": {"type": "integer", "index": 112, "name": "is_hvr_legacy_order_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 113, "name": "ironclad_workflow_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 114, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.order"}, "source.salesforce_source.salesforce.product_2": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"last_referenced_date": {"type": "timestamp without time zone", "index": 1, "name": "last_referenced_date", "comment": null}, "is_active": {"type": "boolean", "index": 2, "name": "is_active", "comment": null}, "description": {"type": "integer", "index": 3, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 4, "name": "last_modified_date", "comment": null}, "record_type_id": {"type": "text", "index": 5, "name": "record_type_id", "comment": null}, "product_code": {"type": "integer", "index": 6, "name": "product_code", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 8, "name": "last_viewed_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 12, "name": "name", "comment": null}, "id": {"type": "text", "index": 13, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": null}, "family": {"type": "text", "index": 16, "name": "family", "comment": null}, "max_volume_c": {"type": "integer", "index": 17, "name": "max_volume_c", "comment": null}, "min_volume_c": {"type": "integer", "index": 18, "name": "min_volume_c", "comment": null}, "request_name_c": {"type": "integer", "index": 19, "name": "request_name_c", "comment": null}, "default_quantity_c": {"type": "integer", "index": 20, "name": "default_quantity_c", "comment": null}, "account_c": {"type": "integer", "index": 21, "name": "account_c", "comment": null}, "related_product_c": {"type": "integer", "index": 22, "name": "related_product_c", "comment": null}, "picklist_value_c": {"type": "integer", "index": 23, "name": "picklist_value_c", "comment": null}, "as_input_c": {"type": "integer", "index": 24, "name": "as_input_c", "comment": null}, "as_output_c": {"type": "integer", "index": 25, "name": "as_output_c", "comment": null}, "status_c": {"type": "integer", "index": 26, "name": "status_c", "comment": null}, "number_of_quantity_installments": {"type": "integer", "index": 27, "name": "number_of_quantity_installments", "comment": null}, "number_of_revenue_installments": {"type": "integer", "index": 28, "name": "number_of_revenue_installments", "comment": null}, "quantity_installment_period": {"type": "integer", "index": 29, "name": "quantity_installment_period", "comment": null}, "quantity_schedule_type": {"type": "integer", "index": 30, "name": "quantity_schedule_type", "comment": null}, "revenue_installment_period": {"type": "integer", "index": 31, "name": "revenue_installment_period", "comment": null}, "revenue_schedule_type": {"type": "integer", "index": 32, "name": "revenue_schedule_type", "comment": null}, "connections_c": {"type": "integer", "index": 33, "name": "connections_c", "comment": null}, "event_volume_c": {"type": "integer", "index": 34, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 35, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 36, "name": "row_volume_c", "comment": null}, "display_url": {"type": "integer", "index": 37, "name": "display_url", "comment": null}, "external_data_source_id": {"type": "integer", "index": 38, "name": "external_data_source_id", "comment": null}, "external_id": {"type": "integer", "index": 39, "name": "external_id", "comment": null}, "quantity_unit_of_measure": {"type": "integer", "index": 40, "name": "quantity_unit_of_measure", "comment": null}, "stock_keeping_unit": {"type": "integer", "index": 41, "name": "stock_keeping_unit", "comment": null}, "features_c": {"type": "integer", "index": 42, "name": "features_c", "comment": null}, "tier_3_price_c": {"type": "integer", "index": 43, "name": "tier_3_price_c", "comment": null}, "tier_2_price_c": {"type": "integer", "index": 44, "name": "tier_2_price_c", "comment": null}, "tier_4_price_c": {"type": "integer", "index": 45, "name": "tier_4_price_c", "comment": null}, "tier_1_price_c": {"type": "integer", "index": 46, "name": "tier_1_price_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 47, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 48, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 49, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "text", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 53, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_net_suite_item_type_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_item_type_c", "comment": null}, "netsuite_conn_sub_type_c": {"type": "text", "index": 55, "name": "netsuite_conn_sub_type_c", "comment": null}, "is_new_c": {"type": "boolean", "index": 56, "name": "is_new_c", "comment": null}, "product_metadata_c": {"type": "integer", "index": 57, "name": "product_metadata_c", "comment": null}, "product_metadata_del_c": {"type": "integer", "index": 58, "name": "product_metadata_del_c", "comment": null}, "sbqq_asset_amendment_behavior_c": {"type": "text", "index": 59, "name": "sbqq_asset_amendment_behavior_c", "comment": null}, "sbqq_asset_conversion_c": {"type": "text", "index": 60, "name": "sbqq_asset_conversion_c", "comment": null}, "sbqq_batch_quantity_c": {"type": "integer", "index": 61, "name": "sbqq_batch_quantity_c", "comment": null}, "sbqq_billing_frequency_c": {"type": "text", "index": 62, "name": "sbqq_billing_frequency_c", "comment": null}, "sbqq_billing_type_c": {"type": "text", "index": 63, "name": "sbqq_billing_type_c", "comment": null}, "sbqq_block_pricing_field_c": {"type": "text", "index": 64, "name": "sbqq_block_pricing_field_c", "comment": null}, "sbqq_charge_type_c": {"type": "text", "index": 65, "name": "sbqq_charge_type_c", "comment": null}, "sbqq_component_c": {"type": "boolean", "index": 66, "name": "sbqq_component_c", "comment": null}, "sbqq_compound_discount_rate_c": {"type": "integer", "index": 67, "name": "sbqq_compound_discount_rate_c", "comment": null}, "sbqq_configuration_event_c": {"type": "integer", "index": 68, "name": "sbqq_configuration_event_c", "comment": null}, "sbqq_configuration_field_set_c": {"type": "integer", "index": 69, "name": "sbqq_configuration_field_set_c", "comment": null}, "sbqq_configuration_fields_c": {"type": "integer", "index": 70, "name": "sbqq_configuration_fields_c", "comment": null}, "sbqq_configuration_form_title_c": {"type": "integer", "index": 71, "name": "sbqq_configuration_form_title_c", "comment": null}, "sbqq_configuration_type_c": {"type": "integer", "index": 72, "name": "sbqq_configuration_type_c", "comment": null}, "sbqq_configuration_validator_c": {"type": "integer", "index": 73, "name": "sbqq_configuration_validator_c", "comment": null}, "sbqq_configured_code_pattern_c": {"type": "integer", "index": 74, "name": "sbqq_configured_code_pattern_c", "comment": null}, "sbqq_configured_description_pattern_c": {"type": "integer", "index": 75, "name": "sbqq_configured_description_pattern_c", "comment": null}, "sbqq_cost_editable_c": {"type": "boolean", "index": 76, "name": "sbqq_cost_editable_c", "comment": null}, "sbqq_cost_schedule_c": {"type": "integer", "index": 77, "name": "sbqq_cost_schedule_c", "comment": null}, "sbqq_custom_configuration_page_c": {"type": "integer", "index": 78, "name": "sbqq_custom_configuration_page_c", "comment": null}, "sbqq_custom_configuration_required_c": {"type": "boolean", "index": 79, "name": "sbqq_custom_configuration_required_c", "comment": null}, "sbqq_customer_community_availability_c": {"type": "integer", "index": 80, "name": "sbqq_customer_community_availability_c", "comment": null}, "sbqq_default_pricing_table_c": {"type": "integer", "index": 81, "name": "sbqq_default_pricing_table_c", "comment": null}, "sbqq_default_quantity_c": {"type": "integer", "index": 82, "name": "sbqq_default_quantity_c", "comment": null}, "sbqq_description_locked_c": {"type": "boolean", "index": 83, "name": "sbqq_description_locked_c", "comment": null}, "sbqq_discount_category_c": {"type": "integer", "index": 84, "name": "sbqq_discount_category_c", "comment": null}, "sbqq_discount_schedule_c": {"type": "integer", "index": 85, "name": "sbqq_discount_schedule_c", "comment": null}, "sbqq_dynamic_pricing_constraint_c": {"type": "integer", "index": 86, "name": "sbqq_dynamic_pricing_constraint_c", "comment": null}, "sbqq_exclude_from_maintenance_c": {"type": "boolean", "index": 87, "name": "sbqq_exclude_from_maintenance_c", "comment": null}, "sbqq_exclude_from_opportunity_c": {"type": "boolean", "index": 88, "name": "sbqq_exclude_from_opportunity_c", "comment": null}, "sbqq_externally_configurable_c": {"type": "boolean", "index": 89, "name": "sbqq_externally_configurable_c", "comment": null}, "sbqq_generate_contracted_price_c": {"type": "integer", "index": 90, "name": "sbqq_generate_contracted_price_c", "comment": null}, "sbqq_has_configuration_attributes_c": {"type": "boolean", "index": 91, "name": "sbqq_has_configuration_attributes_c", "comment": null}, "sbqq_has_consumption_schedule_c": {"type": "boolean", "index": 92, "name": "sbqq_has_consumption_schedule_c", "comment": null}, "sbqq_hidden_c": {"type": "boolean", "index": 93, "name": "sbqq_hidden_c", "comment": null}, "sbqq_hide_price_in_search_results_c": {"type": "boolean", "index": 94, "name": "sbqq_hide_price_in_search_results_c", "comment": null}, "sbqq_include_in_maintenance_c": {"type": "boolean", "index": 95, "name": "sbqq_include_in_maintenance_c", "comment": null}, "sbqq_new_quote_group_c": {"type": "boolean", "index": 96, "name": "sbqq_new_quote_group_c", "comment": null}, "sbqq_non_discountable_c": {"type": "boolean", "index": 97, "name": "sbqq_non_discountable_c", "comment": null}, "sbqq_non_partner_discountable_c": {"type": "boolean", "index": 98, "name": "sbqq_non_partner_discountable_c", "comment": null}, "sbqq_option_layout_c": {"type": "integer", "index": 99, "name": "sbqq_option_layout_c", "comment": null}, "sbqq_option_selection_method_c": {"type": "text", "index": 100, "name": "sbqq_option_selection_method_c", "comment": null}, "sbqq_optional_c": {"type": "boolean", "index": 101, "name": "sbqq_optional_c", "comment": null}, "sbqq_price_editable_c": {"type": "boolean", "index": 102, "name": "sbqq_price_editable_c", "comment": null}, "sbqq_pricing_method_c": {"type": "text", "index": 103, "name": "sbqq_pricing_method_c", "comment": null}, "sbqq_pricing_method_editable_c": {"type": "boolean", "index": 104, "name": "sbqq_pricing_method_editable_c", "comment": null}, "sbqq_product_picture_id_c": {"type": "integer", "index": 105, "name": "sbqq_product_picture_id_c", "comment": null}, "sbqq_quantity_editable_c": {"type": "boolean", "index": 106, "name": "sbqq_quantity_editable_c", "comment": null}, "sbqq_quantity_scale_c": {"type": "integer", "index": 107, "name": "sbqq_quantity_scale_c", "comment": null}, "sbqq_reconfiguration_disabled_c": {"type": "boolean", "index": 108, "name": "sbqq_reconfiguration_disabled_c", "comment": null}, "sbqq_renewal_product_c": {"type": "integer", "index": 109, "name": "sbqq_renewal_product_c", "comment": null}, "sbqq_sort_order_c": {"type": "integer", "index": 110, "name": "sbqq_sort_order_c", "comment": null}, "sbqq_specifications_c": {"type": "integer", "index": 111, "name": "sbqq_specifications_c", "comment": null}, "sbqq_subscription_base_c": {"type": "text", "index": 112, "name": "sbqq_subscription_base_c", "comment": null}, "sbqq_subscription_category_c": {"type": "integer", "index": 113, "name": "sbqq_subscription_category_c", "comment": null}, "sbqq_subscription_percent_c": {"type": "integer", "index": 114, "name": "sbqq_subscription_percent_c", "comment": null}, "sbqq_subscription_pricing_c": {"type": "text", "index": 115, "name": "sbqq_subscription_pricing_c", "comment": null}, "sbqq_subscription_target_c": {"type": "integer", "index": 116, "name": "sbqq_subscription_target_c", "comment": null}, "sbqq_subscription_term_c": {"type": "integer", "index": 117, "name": "sbqq_subscription_term_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 118, "name": "sbqq_subscription_type_c", "comment": null}, "sbqq_tax_code_c": {"type": "integer", "index": 119, "name": "sbqq_tax_code_c", "comment": null}, "sbqq_taxable_c": {"type": "boolean", "index": 120, "name": "sbqq_taxable_c", "comment": null}, "sbqq_term_discount_level_c": {"type": "integer", "index": 121, "name": "sbqq_term_discount_level_c", "comment": null}, "sbqq_term_discount_schedule_c": {"type": "integer", "index": 122, "name": "sbqq_term_discount_schedule_c", "comment": null}, "sbqq_upgrade_credit_c": {"type": "integer", "index": 123, "name": "sbqq_upgrade_credit_c", "comment": null}, "sbqq_upgrade_ratio_c": {"type": "integer", "index": 124, "name": "sbqq_upgrade_ratio_c", "comment": null}, "sbqq_upgrade_source_c": {"type": "integer", "index": 125, "name": "sbqq_upgrade_source_c", "comment": null}, "sbqq_upgrade_target_c": {"type": "integer", "index": 126, "name": "sbqq_upgrade_target_c", "comment": null}, "connector_type_c": {"type": "text", "index": 127, "name": "connector_type_c", "comment": null}, "pbf_pro_type_discount_c": {"type": "boolean", "index": 128, "name": "pbf_pro_type_discount_c", "comment": null}, "dimension_c": {"type": "text", "index": 129, "name": "dimension_c", "comment": null}, "connector_status_c": {"type": "text", "index": 130, "name": "connector_status_c", "comment": null}, "dimension_definition_c": {"type": "integer", "index": 131, "name": "dimension_definition_c", "comment": null}, "ava_sfcpq_tax_code_c": {"type": "integer", "index": 132, "name": "ava_sfcpq_tax_code_c", "comment": null}, "paid_consumption_c": {"type": "integer", "index": 133, "name": "paid_consumption_c", "comment": null}, "is_complimentary_c": {"type": "boolean", "index": 134, "name": "is_complimentary_c", "comment": null}, "product_external_id_c": {"type": "integer", "index": 135, "name": "product_external_id_c", "comment": null}, "blng_billing_rule_c": {"type": "text", "index": 136, "name": "blng_billing_rule_c", "comment": null}, "blng_revenue_recognition_rule_c": {"type": "text", "index": 137, "name": "blng_revenue_recognition_rule_c", "comment": null}, "blng_tax_rule_c": {"type": "text", "index": 138, "name": "blng_tax_rule_c", "comment": null}, "deployment_date_c": {"type": "integer", "index": 139, "name": "deployment_date_c", "comment": null}, "do_not_prorate_c": {"type": "boolean", "index": 140, "name": "do_not_prorate_c", "comment": null}, "celigo_sfnsio_netsuite_id_c": {"type": "integer", "index": 141, "name": "celigo_sfnsio_netsuite_id_c", "comment": null}, "sbqq_enable_large_configuration_c": {"type": "boolean", "index": 142, "name": "sbqq_enable_large_configuration_c", "comment": null}, "sbqq_pricing_guidance_c": {"type": "integer", "index": 143, "name": "sbqq_pricing_guidance_c", "comment": null}, "celigo_sfnsio_item_pricing_type_c": {"type": "integer", "index": 144, "name": "celigo_sfnsio_item_pricing_type_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 145, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_celigo_last_modified_date_c": {"type": "timestamp without time zone", "index": 146, "name": "celigo_sfnsio_celigo_last_modified_date_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 147, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 148, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_item_type_c": {"type": "integer", "index": 149, "name": "celigo_sfnsio_net_suite_item_type_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 150, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "promo_code_c": {"type": "integer", "index": 151, "name": "promo_code_c", "comment": null}, "product_category_c": {"type": "integer", "index": 152, "name": "product_category_c", "comment": null}, "product_source_c": {"type": "integer", "index": 153, "name": "product_source_c", "comment": null}, "non_recurring_c": {"type": "boolean", "index": 154, "name": "non_recurring_c", "comment": null}, "is_archived": {"type": "boolean", "index": 155, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 156, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.product_2"}, "source.salesforce_source.salesforce.task": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"referral_account_c": {"type": "integer", "index": 1, "name": "referral_account_c", "comment": null}, "who_id": {"type": "text", "index": 2, "name": "who_id", "comment": null}, "call_disposition": {"type": "integer", "index": 3, "name": "call_disposition", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 4, "name": "recurrence_day_of_month", "comment": null}, "owner_id": {"type": "text", "index": 5, "name": "owner_id", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 6, "name": "recurrence_end_date_only", "comment": null}, "subject": {"type": "text", "index": 7, "name": "subject", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 9, "name": "last_modified_date", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 10, "name": "recurrence_time_zone_sid_key", "comment": null}, "is_recurrence": {"type": "boolean", "index": 11, "name": "is_recurrence", "comment": null}, "what_count": {"type": "integer", "index": 12, "name": "what_count", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "call_object": {"type": "integer", "index": 14, "name": "call_object", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 16, "name": "recurrence_day_of_week_mask", "comment": null}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 18, "name": "system_modstamp", "comment": null}, "recurrence_regenerated_type": {"type": "integer", "index": 19, "name": "recurrence_regenerated_type", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "recurrence_type": {"type": "integer", "index": 21, "name": "recurrence_type", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 22, "name": "reminder_date_time", "comment": null}, "call_type": {"type": "integer", "index": 23, "name": "call_type", "comment": null}, "is_high_priority": {"type": "boolean", "index": 24, "name": "is_high_priority", "comment": null}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 26, "name": "recurrence_month_of_year", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 27, "name": "is_reminder_set", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 28, "name": "activity_date", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "priority": {"type": "text", "index": 30, "name": "priority", "comment": null}, "recurrence_interval": {"type": "integer", "index": 31, "name": "recurrence_interval", "comment": null}, "who_count": {"type": "integer", "index": 32, "name": "who_count", "comment": null}, "recurrence_start_date_only": {"type": "timestamp without time zone", "index": 33, "name": "recurrence_start_date_only", "comment": null}, "account_id": {"type": "text", "index": 34, "name": "account_id", "comment": null}, "referral_contact_c": {"type": "integer", "index": 35, "name": "referral_contact_c", "comment": null}, "call_duration_in_seconds": {"type": "integer", "index": 36, "name": "call_duration_in_seconds", "comment": null}, "created_by_id": {"type": "text", "index": 37, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 38, "name": "created_date", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 39, "name": "recurrence_activity_id", "comment": null}, "what_id": {"type": "text", "index": 40, "name": "what_id", "comment": null}, "task_subtype": {"type": "text", "index": 41, "name": "task_subtype", "comment": null}, "status": {"type": "text", "index": 42, "name": "status", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 43, "name": "invitee_uuid_c", "comment": null}, "type": {"type": "text", "index": 44, "name": "type", "comment": null}, "no_show_c": {"type": "boolean", "index": 45, "name": "no_show_c", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 46, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 47, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 48, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 49, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 50, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 52, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 53, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 54, "name": "lid_date_sent_c", "comment": null}, "record_type_id": {"type": "text", "index": 55, "name": "record_type_id", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "completed_date_time": {"type": "timestamp without time zone", "index": 78, "name": "completed_date_time", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 79, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 80, "name": "partner_contact_c", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 81, "name": "co_selling_activity_c", "comment": null}, "description_c": {"type": "integer", "index": 82, "name": "description_c", "comment": null}, "co_sell_partner_account_c": {"type": "integer", "index": 83, "name": "co_sell_partner_account_c", "comment": null}, "campaign_c": {"type": "integer", "index": 84, "name": "campaign_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 85, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 86, "name": "topic_c", "comment": null}, "event_name_c": {"type": "integer", "index": 87, "name": "event_name_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 88, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 89, "name": "partner_activity_type_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 90, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 91, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 92, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 93, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 94, "name": "vidyard_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 95, "name": "expected_payment_date_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 96, "name": "execute_collections_plan_activity_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 97, "name": "collections_hold_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 98, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "text", "index": 99, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "text", "index": 100, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 101, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 102, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "text", "index": 103, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "text", "index": 104, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 105, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 106, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 107, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.task"}, "source.salesforce_source.salesforce.user": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "about_me": {"type": "integer", "index": 3, "name": "about_me", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "alias": {"type": "text", "index": 5, "name": "alias", "comment": null}, "badge_text": {"type": "text", "index": 6, "name": "badge_text", "comment": null}, "banner_photo_url": {"type": "text", "index": 7, "name": "banner_photo_url", "comment": null}, "call_center_id": {"type": "integer", "index": 8, "name": "call_center_id", "comment": null}, "city": {"type": "integer", "index": 9, "name": "city", "comment": null}, "community_nickname": {"type": "text", "index": 10, "name": "community_nickname", "comment": null}, "company_name": {"type": "integer", "index": 11, "name": "company_name", "comment": null}, "contact_id": {"type": "integer", "index": 12, "name": "contact_id", "comment": null}, "country": {"type": "text", "index": 13, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 14, "name": "country_code", "comment": null}, "default_group_notification_frequency": {"type": "text", "index": 15, "name": "default_group_notification_frequency", "comment": null}, "delegated_approver_id": {"type": "text", "index": 16, "name": "delegated_approver_id", "comment": null}, "department": {"type": "integer", "index": 17, "name": "department", "comment": null}, "digest_frequency": {"type": "text", "index": 18, "name": "digest_frequency", "comment": null}, "division": {"type": "integer", "index": 19, "name": "division", "comment": null}, "email": {"type": "text", "index": 20, "name": "email", "comment": null}, "email_encoding_key": {"type": "text", "index": 21, "name": "email_encoding_key", "comment": null}, "email_preferences_auto_bcc": {"type": "boolean", "index": 22, "name": "email_preferences_auto_bcc", "comment": null}, "employee_number": {"type": "integer", "index": 23, "name": "employee_number", "comment": null}, "extension": {"type": "integer", "index": 24, "name": "extension", "comment": null}, "fax": {"type": "integer", "index": 25, "name": "fax", "comment": null}, "federation_identifier": {"type": "integer", "index": 26, "name": "federation_identifier", "comment": null}, "first_name": {"type": "text", "index": 27, "name": "first_name", "comment": null}, "forecast_enabled": {"type": "boolean", "index": 28, "name": "forecast_enabled", "comment": null}, "full_photo_url": {"type": "text", "index": 29, "name": "full_photo_url", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 30, "name": "geocode_accuracy", "comment": null}, "id": {"type": "text", "index": 31, "name": "id", "comment": null}, "individual_id": {"type": "integer", "index": 32, "name": "individual_id", "comment": null}, "is_active": {"type": "boolean", "index": 33, "name": "is_active", "comment": null}, "is_profile_photo_active": {"type": "boolean", "index": 34, "name": "is_profile_photo_active", "comment": null}, "language_locale_key": {"type": "text", "index": 35, "name": "language_locale_key", "comment": null}, "last_login_date": {"type": "timestamp without time zone", "index": 36, "name": "last_login_date", "comment": null}, "last_name": {"type": "text", "index": 37, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 38, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 39, "name": "last_viewed_date", "comment": null}, "latitude": {"type": "double precision", "index": 40, "name": "latitude", "comment": null}, "locale_sid_key": {"type": "text", "index": 41, "name": "locale_sid_key", "comment": null}, "longitude": {"type": "double precision", "index": 42, "name": "longitude", "comment": null}, "manager_id": {"type": "text", "index": 43, "name": "manager_id", "comment": null}, "medium_banner_photo_url": {"type": "text", "index": 44, "name": "medium_banner_photo_url", "comment": null}, "mobile_phone": {"type": "integer", "index": 45, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 46, "name": "name", "comment": null}, "offline_trial_expiration_date": {"type": "timestamp without time zone", "index": 47, "name": "offline_trial_expiration_date", "comment": null}, "phone": {"type": "text", "index": 48, "name": "phone", "comment": null}, "postal_code": {"type": "integer", "index": 49, "name": "postal_code", "comment": null}, "profile_id": {"type": "text", "index": 50, "name": "profile_id", "comment": null}, "receives_admin_info_emails": {"type": "boolean", "index": 51, "name": "receives_admin_info_emails", "comment": null}, "receives_info_emails": {"type": "boolean", "index": 52, "name": "receives_info_emails", "comment": null}, "sender_email": {"type": "integer", "index": 53, "name": "sender_email", "comment": null}, "sender_name": {"type": "integer", "index": 54, "name": "sender_name", "comment": null}, "signature": {"type": "integer", "index": 55, "name": "signature", "comment": null}, "small_banner_photo_url": {"type": "text", "index": 56, "name": "small_banner_photo_url", "comment": null}, "small_photo_url": {"type": "text", "index": 57, "name": "small_photo_url", "comment": null}, "state": {"type": "integer", "index": 58, "name": "state", "comment": null}, "state_code": {"type": "integer", "index": 59, "name": "state_code", "comment": null}, "street": {"type": "integer", "index": 60, "name": "street", "comment": null}, "time_zone_sid_key": {"type": "text", "index": 61, "name": "time_zone_sid_key", "comment": null}, "title": {"type": "text", "index": 62, "name": "title", "comment": null}, "user_role_id": {"type": "text", "index": 63, "name": "user_role_id", "comment": null}, "user_type": {"type": "text", "index": 64, "name": "user_type", "comment": null}, "username": {"type": "text", "index": 65, "name": "username", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 66, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.user"}, "source.salesforce_source.salesforce.user_role": {"metadata": {"type": "BASE TABLE", "schema": "zz_dbt_catherine_sf", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "case_access_for_account_owner": {"type": "text", "index": 3, "name": "case_access_for_account_owner", "comment": null}, "contact_access_for_account_owner": {"type": "text", "index": 4, "name": "contact_access_for_account_owner", "comment": null}, "developer_name": {"type": "text", "index": 5, "name": "developer_name", "comment": null}, "forecast_user_id": {"type": "integer", "index": 6, "name": "forecast_user_id", "comment": null}, "id": {"type": "text", "index": 7, "name": "id", "comment": null}, "may_forecast_manager_share": {"type": "boolean", "index": 8, "name": "may_forecast_manager_share", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "opportunity_access_for_account_owner": {"type": "text", "index": 10, "name": "opportunity_access_for_account_owner", "comment": null}, "parent_role_id": {"type": "text", "index": 11, "name": "parent_role_id", "comment": null}, "portal_type": {"type": "text", "index": 12, "name": "portal_type", "comment": null}, "rollup_description": {"type": "text", "index": 13, "name": "rollup_description", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 14, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.user_role"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.8.3", "generated_at": "2024-07-23T21:34:55.935903Z", "invocation_id": "8953cfeb-e6f4-47c1-be99-b3c6436f0b90", "env": {}}, "nodes": {"seed.salesforce_integration_tests.sf_account_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 2, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 4, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "text", "index": 7, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 8, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "double precision", "index": 9, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "double precision", "index": 10, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 11, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 12, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 13, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 14, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 15, "name": "description", "comment": null}, "fax": {"type": "integer", "index": 16, "name": "fax", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "industry": {"type": "text", "index": 18, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "jigsaw_company_id": {"type": "integer", "index": 20, "name": "jigsaw_company_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": null}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 31, "name": "photo_url", "comment": null}, "rating": {"type": "integer", "index": 32, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 33, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "double precision", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "double precision", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "integer", "index": 43, "name": "shipping_street", "comment": null}, "sic": {"type": "integer", "index": 44, "name": "sic", "comment": null}, "sic_desc": {"type": "integer", "index": 45, "name": "sic_desc", "comment": null}, "site": {"type": "integer", "index": 46, "name": "site", "comment": null}, "ticker_symbol": {"type": "integer", "index": 47, "name": "ticker_symbol", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "website": {"type": "text", "index": 49, "name": "website", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 50, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_account_data"}, "seed.salesforce_integration_tests.sf_account_history_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 5, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 6, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 7, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 8, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 9, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 10, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 11, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 13, "name": "description", "comment": null}, "id": {"type": "text", "index": 14, "name": "id", "comment": null}, "industry": {"type": "text", "index": 15, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 16, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 20, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 21, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 22, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 23, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 24, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 25, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 26, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 27, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 28, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 30, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 31, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 32, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 33, "name": "type", "comment": null}, "website": {"type": "text", "index": 34, "name": "website", "comment": null}}, "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.salesforce_integration_tests.sf_account_history_data"}, "seed.salesforce_integration_tests.sf_contact_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "cbit_clearbit_c": {"type": "text", "index": 4, "name": "cbit_clearbit_c", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 5, "name": "cbit_clearbit_ready_c", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "department": {"type": "integer", "index": 8, "name": "department", "comment": null}, "email": {"type": "text", "index": 9, "name": "email", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 10, "name": "email_bounced_date", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 11, "name": "email_bounced_reason", "comment": null}, "fax": {"type": "integer", "index": 12, "name": "fax", "comment": null}, "first_name": {"type": "text", "index": 13, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": null}, "is_email_bounced": {"type": "boolean", "index": 15, "name": "is_email_bounced", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 16, "name": "jigsaw_contact_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_curequest_date": {"type": "timestamp without time zone", "index": 18, "name": "last_curequest_date", "comment": null}, "last_cuupdate_date": {"type": "timestamp without time zone", "index": 19, "name": "last_cuupdate_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 22, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 25, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 26, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 27, "name": "mailing_country_code", "comment": null}, "mailing_geocode_accuracy": {"type": "integer", "index": 28, "name": "mailing_geocode_accuracy", "comment": null}, "mailing_latitude": {"type": "integer", "index": 29, "name": "mailing_latitude", "comment": null}, "mailing_longitude": {"type": "integer", "index": 30, "name": "mailing_longitude", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 31, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 32, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 33, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 34, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 35, "name": "master_record_id", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 36, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "mobile_phone": {"type": "integer", "index": 37, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 38, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 39, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 40, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 41, "name": "photo_url", "comment": null}, "reports_to_id": {"type": "integer", "index": 42, "name": "reports_to_id", "comment": null}, "salutation": {"type": "integer", "index": 43, "name": "salutation", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 44, "name": "system_modstamp", "comment": null}, "title": {"type": "text", "index": 45, "name": "title", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 46, "name": "email_bounced_c", "comment": null}, "email_quality_unknown_c": {"type": "boolean", "index": 47, "name": "email_quality_unknown_c", "comment": null}, "gclid_c": {"type": "integer", "index": 48, "name": "gclid_c", "comment": null}, "referral_account_c": {"type": "integer", "index": 49, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 50, "name": "referral_contact_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 51, "name": "has_opted_out_of_email", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 52, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 53, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 54, "name": "fivetran_user_id_c", "comment": null}, "no_longer_at_company_c": {"type": "boolean", "index": 55, "name": "no_longer_at_company_c", "comment": null}, "pi_campaign_c": {"type": "text", "index": 56, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 57, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 58, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 59, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 60, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "timestamp without time zone", "index": 61, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 62, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 63, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 64, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 65, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 66, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 67, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "boolean", "index": 68, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 69, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "boolean", "index": 70, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 71, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 72, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "text", "index": 73, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 74, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 75, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 76, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 77, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 78, "name": "pi_utm_term_c", "comment": null}, "lead_source": {"type": "text", "index": 79, "name": "lead_source", "comment": null}, "contact_status_c": {"type": "text", "index": 80, "name": "contact_status_c", "comment": null}, "region_c": {"type": "integer", "index": 81, "name": "region_c", "comment": null}, "competitor_c": {"type": "integer", "index": 82, "name": "competitor_c", "comment": null}, "bt_stripe_gender_c": {"type": "integer", "index": 83, "name": "bt_stripe_gender_c", "comment": null}, "bt_stripe_ssn_last_4_encrypted_c": {"type": "integer", "index": 84, "name": "bt_stripe_ssn_last_4_encrypted_c", "comment": null}, "bt_stripe_personal_id_number_c": {"type": "integer", "index": 85, "name": "bt_stripe_personal_id_number_c", "comment": null}, "bt_stripe_personal_id_number_encrypted_c": {"type": "integer", "index": 86, "name": "bt_stripe_personal_id_number_encrypted_c", "comment": null}, "bt_stripe_maiden_name_c": {"type": "integer", "index": 87, "name": "bt_stripe_maiden_name_c", "comment": null}, "bt_stripe_languages_c": {"type": "integer", "index": 88, "name": "bt_stripe_languages_c", "comment": null}, "bt_stripe_default_payment_method_c": {"type": "integer", "index": 89, "name": "bt_stripe_default_payment_method_c", "comment": null}, "bt_stripe_ssn_last_4_c": {"type": "integer", "index": 90, "name": "bt_stripe_ssn_last_4_c", "comment": null}, "bt_stripe_personal_id_type_c": {"type": "integer", "index": 91, "name": "bt_stripe_personal_id_type_c", "comment": null}, "bt_stripe_default_payment_gateway_c": {"type": "integer", "index": 92, "name": "bt_stripe_default_payment_gateway_c", "comment": null}, "bt_stripe_level_c": {"type": "integer", "index": 93, "name": "bt_stripe_level_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 94, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 95, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 96, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 97, "name": "lean_data_tag_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 98, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 99, "name": "do_not_route_lead_c", "comment": null}, "technical_contact_c": {"type": "integer", "index": 100, "name": "technical_contact_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 101, "name": "allbound_id_c", "comment": null}, "notes_c": {"type": "integer", "index": 102, "name": "notes_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 103, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 104, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 105, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 106, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 107, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_pushed_from_opportunity_c": {"type": "boolean", "index": 108, "name": "netsuite_conn_pushed_from_opportunity_c", "comment": null}, "description": {"type": "text", "index": 109, "name": "description", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 110, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 111, "name": "lid_linked_in_member_token_c", "comment": null}, "is_eu_resident_c": {"type": "boolean", "index": 112, "name": "is_eu_resident_c", "comment": null}, "do_not_call": {"type": "boolean", "index": 113, "name": "do_not_call", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 114, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 115, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 116, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "source_detail_c": {"type": "text", "index": 117, "name": "source_detail_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 118, "name": "utm_source_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 119, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 120, "name": "utm_term_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 121, "name": "utm_medium_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 122, "name": "utm_campaign_c", "comment": null}, "network_c": {"type": "integer", "index": 123, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 124, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 125, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 126, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 127, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 128, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 129, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 130, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 131, "name": "partner_rep_name_c", "comment": null}, "contact_type_c": {"type": "integer", "index": 132, "name": "contact_type_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 133, "name": "old_lead_source_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 134, "name": "old_lead_source_detail_c", "comment": null}, "contact_stage_c": {"type": "integer", "index": 135, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 136, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 137, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 138, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 139, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 140, "name": "original_utm_term_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 141, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 142, "name": "es_app_esecid_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 143, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 144, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 145, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 146, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 147, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 148, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 149, "name": "es_app_essource_c", "comment": null}, "individual_id": {"type": "integer", "index": 150, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 151, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 152, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 153, "name": "user_gems_has_changed_job_c", "comment": null}, "email_opt_in_explicit_c": {"type": "integer", "index": 154, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "integer", "index": 155, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "integer", "index": 156, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "integer", "index": 157, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 158, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 159, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 160, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 161, "name": "user_gems_past_title_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 162, "name": "partner_contact_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 163, "name": "promotion_id_c", "comment": null}, "referral_exists_c": {"type": "integer", "index": 164, "name": "referral_exists_c", "comment": null}, "referral_first_name_c": {"type": "integer", "index": 165, "name": "referral_first_name_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 166, "name": "referral_last_name_c", "comment": null}, "mkto_71_contact_acquisition_date_c": {"type": "integer", "index": 167, "name": "mkto_71_contact_acquisition_date_c", "comment": null}, "mkto_71_contact_acquisition_program_c": {"type": "integer", "index": 168, "name": "mkto_71_contact_acquisition_program_c", "comment": null}, "mkto_71_contact_acquisition_program_id_c": {"type": "integer", "index": 169, "name": "mkto_71_contact_acquisition_program_id_c", "comment": null}, "mkto_71_contact_inferred_city_c": {"type": "integer", "index": 170, "name": "mkto_71_contact_inferred_city_c", "comment": null}, "mkto_71_contact_inferred_company_c": {"type": "integer", "index": 171, "name": "mkto_71_contact_inferred_company_c", "comment": null}, "mkto_71_contact_inferred_country_c": {"type": "integer", "index": 172, "name": "mkto_71_contact_inferred_country_c", "comment": null}, "mkto_71_contact_inferred_metropolitan_a_c": {"type": "integer", "index": 173, "name": "mkto_71_contact_inferred_metropolitan_a_c", "comment": null}, "mkto_71_contact_inferred_phone_area_cod_c": {"type": "integer", "index": 174, "name": "mkto_71_contact_inferred_phone_area_cod_c", "comment": null}, "mkto_71_contact_inferred_postal_code_c": {"type": "integer", "index": 175, "name": "mkto_71_contact_inferred_postal_code_c", "comment": null}, "mkto_71_contact_inferred_state_region_c": {"type": "integer", "index": 176, "name": "mkto_71_contact_inferred_state_region_c", "comment": null}, "mkto_71_contact_lead_score_c": {"type": "integer", "index": 177, "name": "mkto_71_contact_lead_score_c", "comment": null}, "mkto_71_contact_original_referrer_c": {"type": "integer", "index": 178, "name": "mkto_71_contact_original_referrer_c", "comment": null}, "mkto_71_contact_original_search_engine_c": {"type": "integer", "index": 179, "name": "mkto_71_contact_original_search_engine_c", "comment": null}, "mkto_71_contact_original_search_phrase_c": {"type": "integer", "index": 180, "name": "mkto_71_contact_original_search_phrase_c", "comment": null}, "mkto_71_contact_original_source_info_c": {"type": "integer", "index": 181, "name": "mkto_71_contact_original_source_info_c", "comment": null}, "mkto_71_contact_original_source_type_c": {"type": "integer", "index": 182, "name": "mkto_71_contact_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 183, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "integer", "index": 184, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "integer", "index": 185, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "integer", "index": 186, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "integer", "index": 187, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_mkto_lead_score_c": {"type": "integer", "index": 188, "name": "mkto_si_mkto_lead_score_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 189, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 190, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 191, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ces_c": {"type": "integer", "index": 192, "name": "cloudingo_agent_ces_c", "comment": null}, "cloudingo_agent_mar_c": {"type": "integer", "index": 193, "name": "cloudingo_agent_mar_c", "comment": null}, "cloudingo_agent_mas_c": {"type": "integer", "index": 194, "name": "cloudingo_agent_mas_c", "comment": null}, "cloudingo_agent_mav_c": {"type": "integer", "index": 195, "name": "cloudingo_agent_mav_c", "comment": null}, "cloudingo_agent_mrdi_c": {"type": "integer", "index": 196, "name": "cloudingo_agent_mrdi_c", "comment": null}, "cloudingo_agent_mtz_c": {"type": "integer", "index": 197, "name": "cloudingo_agent_mtz_c", "comment": null}, "cloudingo_agent_oar_c": {"type": "integer", "index": 198, "name": "cloudingo_agent_oar_c", "comment": null}, "cloudingo_agent_oas_c": {"type": "integer", "index": 199, "name": "cloudingo_agent_oas_c", "comment": null}, "cloudingo_agent_oav_c": {"type": "integer", "index": 200, "name": "cloudingo_agent_oav_c", "comment": null}, "cloudingo_agent_ordi_c": {"type": "integer", "index": 201, "name": "cloudingo_agent_ordi_c", "comment": null}, "cloudingo_agent_otz_c": {"type": "integer", "index": 202, "name": "cloudingo_agent_otz_c", "comment": null}, "do_not_sync_marketo_c": {"type": "integer", "index": 203, "name": "do_not_sync_marketo_c", "comment": null}, "phone_extension_c": {"type": "integer", "index": 204, "name": "phone_extension_c", "comment": null}, "job_function_c": {"type": "integer", "index": 205, "name": "job_function_c", "comment": null}, "job_level_c": {"type": "integer", "index": 206, "name": "job_level_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 207, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 208, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 209, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 210, "name": "state_c", "comment": null}, "secondary_email_c": {"type": "integer", "index": 211, "name": "secondary_email_c", "comment": null}, "es_seniority_c": {"type": "integer", "index": 212, "name": "es_seniority_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 213, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 214, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 215, "name": "source_last_lead_source_detail_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 216, "name": "drift_cql_c", "comment": null}, "hot_contact_c": {"type": "integer", "index": 217, "name": "hot_contact_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 218, "name": "behavioral_score_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 219, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "integer", "index": 220, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 221, "name": "csi_code_c", "comment": null}, "clearbit_role_c": {"type": "integer", "index": 222, "name": "clearbit_role_c", "comment": null}, "clearbit_seniority_c": {"type": "integer", "index": 223, "name": "clearbit_seniority_c", "comment": null}, "clearbit_sub_role_c": {"type": "integer", "index": 224, "name": "clearbit_sub_role_c", "comment": null}, "rh_2_currency_test_c": {"type": "integer", "index": 225, "name": "rh_2_currency_test_c", "comment": null}, "rh_2_describe_c": {"type": "integer", "index": 226, "name": "rh_2_describe_c", "comment": null}, "rh_2_integer_test_c": {"type": "integer", "index": 227, "name": "rh_2_integer_test_c", "comment": null}, "created_by_role_c": {"type": "integer", "index": 228, "name": "created_by_role_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 229, "name": "demographic_score_c", "comment": null}, "country_code_c": {"type": "integer", "index": 230, "name": "country_code_c", "comment": null}, "state_code_c": {"type": "integer", "index": 231, "name": "state_code_c", "comment": null}, "attended_event_c": {"type": "integer", "index": 232, "name": "attended_event_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 233, "name": "zoominfo_technologies_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 234, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 235, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 236, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 237, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 238, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 239, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "integer", "index": 240, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 241, "name": "first_mql_date_c", "comment": null}, "active_relationship_c": {"type": "integer", "index": 242, "name": "active_relationship_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 243, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 244, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 245, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 246, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 247, "name": "clarus_status_c", "comment": null}, "historical_contact_status_c": {"type": "integer", "index": 248, "name": "historical_contact_status_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 249, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 250, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "integer", "index": 251, "name": "mql_reason_c", "comment": null}, "attempting_contact_date_time_c": {"type": "integer", "index": 252, "name": "attempting_contact_date_time_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 253, "name": "linked_in_url_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 254, "name": "trial_contact_start_date_c", "comment": null}, "contact_holdover_c": {"type": "integer", "index": 255, "name": "contact_holdover_c", "comment": null}, "bill_to_contact_hidden_c": {"type": "integer", "index": 256, "name": "bill_to_contact_hidden_c", "comment": null}, "enrichment_request_c": {"type": "integer", "index": 257, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "integer", "index": 258, "name": "meta_data_create_date_c", "comment": null}, "primary_se_c": {"type": "integer", "index": 259, "name": "primary_se_c", "comment": null}, "unqualified_reason_c": {"type": "integer", "index": 260, "name": "unqualified_reason_c", "comment": null}, "opp_handoff_ae_c": {"type": "integer", "index": 261, "name": "opp_handoff_ae_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 262, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 263, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 264, "name": "salesloft_cadence_trigger_c", "comment": null}, "last_ae_activity_owner_c": {"type": "integer", "index": 265, "name": "last_ae_activity_owner_c", "comment": null}, "last_bdr_activity_owner_c": {"type": "integer", "index": 266, "name": "last_bdr_activity_owner_c", "comment": null}, "last_manual_ae_activity_date_c": {"type": "integer", "index": 267, "name": "last_manual_ae_activity_date_c", "comment": null}, "last_manual_bdr_activity_date_c": {"type": "integer", "index": 268, "name": "last_manual_bdr_activity_date_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 269, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "integer", "index": 270, "name": "potential_fivetran_use_case_c", "comment": null}, "lean_data_router_completion_date_time_c": {"type": "integer", "index": 271, "name": "lean_data_router_completion_date_time_c", "comment": null}, "partner_territory_c": {"type": "integer", "index": 272, "name": "partner_territory_c", "comment": null}, "partner_company_c": {"type": "integer", "index": 273, "name": "partner_company_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 274, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 275, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 276, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 277, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 278, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 279, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 280, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 281, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 282, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 283, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 284, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "integer", "index": 285, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 286, "name": "sales_email_opt_out_date_time_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 287, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 288, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_net_suite_sync_error_c": {"type": "integer", "index": 289, "name": "celigo_sfnsio_net_suite_sync_error_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "integer", "index": 290, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "integer", "index": 291, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 292, "name": "ironclad_workflow_c", "comment": null}, "last_sales_activity_date_time_c": {"type": "integer", "index": 293, "name": "last_sales_activity_date_time_c", "comment": null}, "user_activity_logged_by_c": {"type": "integer", "index": 294, "name": "user_activity_logged_by_c", "comment": null}, "first_activity_after_mql_date_c": {"type": "integer", "index": 295, "name": "first_activity_after_mql_date_c", "comment": null}, "last_sdr_activity_owner_c": {"type": "integer", "index": 296, "name": "last_sdr_activity_owner_c", "comment": null}, "last_sdr_activity_date_c": {"type": "integer", "index": 297, "name": "last_sdr_activity_date_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 298, "name": "beta_connector_interest_c", "comment": null}, "first_manual_activity_after_mql_date_c": {"type": "integer", "index": 299, "name": "first_manual_activity_after_mql_date_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 300, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 301, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "integer", "index": 302, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 303, "name": "free_trial_email_confirmed_date_c", "comment": null}, "routed_from_manual_bdr_ae_activity_c": {"type": "integer", "index": 304, "name": "routed_from_manual_bdr_ae_activity_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 305, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "i_sell_avention_id_c": {"type": "integer", "index": 306, "name": "i_sell_avention_id_c", "comment": null}, "persona_c": {"type": "integer", "index": 307, "name": "persona_c", "comment": null}, "last_marketing_interesting_moment_date_c": {"type": "integer", "index": 308, "name": "last_marketing_interesting_moment_date_c", "comment": null}, "verified_c": {"type": "integer", "index": 309, "name": "verified_c", "comment": null}, "salesloft_owner_c": {"type": "integer", "index": 310, "name": "salesloft_owner_c", "comment": null}, "salesloft_owner_sf_c": {"type": "integer", "index": 311, "name": "salesloft_owner_sf_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 312, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_primary_role_c": {"type": "integer", "index": 313, "name": "pbf_startup_primary_role_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "integer", "index": 314, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 315, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 316, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 317, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 318, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 319, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 320, "name": "engagio_role_c", "comment": null}, "mql_date_changed_c": {"type": "integer", "index": 321, "name": "mql_date_changed_c", "comment": null}, "first_activity_after_mql_changed_c": {"type": "integer", "index": 322, "name": "first_activity_after_mql_changed_c", "comment": null}, "birthdate": {"type": "timestamp without time zone", "index": 323, "name": "birthdate", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 324, "name": "legacy_hvr_id_c", "comment": null}, "has_opted_out_of_fax": {"type": "integer", "index": 325, "name": "has_opted_out_of_fax", "comment": null}, "other_latitude": {"type": "integer", "index": 326, "name": "other_latitude", "comment": null}, "username_c": {"type": "integer", "index": 327, "name": "username_c", "comment": null}, "assistant_name": {"type": "integer", "index": 328, "name": "assistant_name", "comment": null}, "created_at_c": {"type": "integer", "index": 329, "name": "created_at_c", "comment": null}, "partner_contact_deprecate_c": {"type": "integer", "index": 330, "name": "partner_contact_deprecate_c", "comment": null}, "other_street": {"type": "integer", "index": 331, "name": "other_street", "comment": null}, "other_state": {"type": "integer", "index": 332, "name": "other_state", "comment": null}, "home_phone": {"type": "integer", "index": 333, "name": "home_phone", "comment": null}, "other_city": {"type": "integer", "index": 334, "name": "other_city", "comment": null}, "company_c": {"type": "integer", "index": 335, "name": "company_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 336, "name": "opportunity_c", "comment": null}, "hvr_update_c": {"type": "integer", "index": 337, "name": "hvr_update_c", "comment": null}, "other_phone": {"type": "integer", "index": 338, "name": "other_phone", "comment": null}, "other_geocode_accuracy": {"type": "integer", "index": 339, "name": "other_geocode_accuracy", "comment": null}, "other_postal_code": {"type": "integer", "index": 340, "name": "other_postal_code", "comment": null}, "other_country": {"type": "integer", "index": 341, "name": "other_country", "comment": null}, "assistant_phone": {"type": "integer", "index": 342, "name": "assistant_phone", "comment": null}, "jigsaw": {"type": "integer", "index": 343, "name": "jigsaw", "comment": null}, "avatar_c": {"type": "integer", "index": 344, "name": "avatar_c", "comment": null}, "other_longitude": {"type": "integer", "index": 345, "name": "other_longitude", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 346, "name": "lean_data_status_info_c", "comment": null}, "analytics_id_c": {"type": "integer", "index": 347, "name": "analytics_id_c", "comment": null}, "dnb_primary_address_postal_code_c": {"type": "integer", "index": 348, "name": "dnb_primary_address_postal_code_c", "comment": null}, "dnb_contact_phone_c": {"type": "integer", "index": 349, "name": "dnb_contact_phone_c", "comment": null}, "dnb_email_deliverability_score_c": {"type": "integer", "index": 350, "name": "dnb_email_deliverability_score_c", "comment": null}, "dnb_job_title_c": {"type": "integer", "index": 351, "name": "dnb_job_title_c", "comment": null}, "dnb_email_c": {"type": "integer", "index": 352, "name": "dnb_email_c", "comment": null}, "dnb_primary_address_city_c": {"type": "integer", "index": 353, "name": "dnb_primary_address_city_c", "comment": null}, "dnb_phone_accuracy_score_c": {"type": "integer", "index": 354, "name": "dnb_phone_accuracy_score_c", "comment": null}, "dnb_primary_address_state_province_c": {"type": "integer", "index": 355, "name": "dnb_primary_address_state_province_c", "comment": null}, "dnb_primary_address_state_province_abbre_c": {"type": "integer", "index": 356, "name": "dnb_primary_address_state_province_abbre_c", "comment": null}, "dnb_primary_address_country_region_code_c": {"type": "integer", "index": 357, "name": "dnb_primary_address_country_region_code_c", "comment": null}, "email_opt_in_double_c": {"type": "integer", "index": 358, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 359, "name": "phone_number_catch_all_c", "comment": null}, "contact_owners_manager_stamped_c": {"type": "integer", "index": 360, "name": "contact_owners_manager_stamped_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 361, "name": "fivetran_account_id_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 362, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 363, "name": "utm_id_c", "comment": null}, "self_service_routing_c": {"type": "integer", "index": 364, "name": "self_service_routing_c", "comment": null}, "no_geo_data_c": {"type": "integer", "index": 365, "name": "no_geo_data_c", "comment": null}, "to_be_deleted_salesloft_backfill_c": {"type": "integer", "index": 366, "name": "to_be_deleted_salesloft_backfill_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 367, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 368, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_contact_data"}, "seed.salesforce_integration_tests.sf_contact_history_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 6, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 7, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 8, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 10, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 13, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 14, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 16, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 17, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 18, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 19, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 20, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 21, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 22, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 23, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 24, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 26, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 27, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 30, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 31, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 32, "name": "home_phone", "comment": null}}, "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.salesforce_integration_tests.sf_contact_history_data"}, "seed.salesforce_integration_tests.sf_event_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "duration_in_minutes": {"type": "integer", "index": 9, "name": "duration_in_minutes", "comment": null}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": null}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": null}, "group_event_type": {"type": "integer", "index": 12, "name": "group_event_type", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 13, "name": "invitee_uuid_c", "comment": null}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": null}, "is_private": {"type": "boolean", "index": 17, "name": "is_private", "comment": null}, "is_recurrence": {"type": "boolean", "index": 18, "name": "is_recurrence", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 19, "name": "is_reminder_set", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "location": {"type": "integer", "index": 22, "name": "location", "comment": null}, "no_show_c": {"type": "boolean", "index": 23, "name": "no_show_c", "comment": null}, "owner_id": {"type": "text", "index": 24, "name": "owner_id", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 25, "name": "recurrence_activity_id", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 26, "name": "recurrence_day_of_month", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 27, "name": "recurrence_day_of_week_mask", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 28, "name": "recurrence_end_date_only", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "recurrence_interval": {"type": "integer", "index": 30, "name": "recurrence_interval", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 31, "name": "recurrence_month_of_year", "comment": null}, "recurrence_start_date_time": {"type": "timestamp without time zone", "index": 32, "name": "recurrence_start_date_time", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 33, "name": "recurrence_time_zone_sid_key", "comment": null}, "recurrence_type": {"type": "integer", "index": 34, "name": "recurrence_type", "comment": null}, "referral_account_c": {"type": "integer", "index": 35, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 36, "name": "referral_contact_c", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 37, "name": "reminder_date_time", "comment": null}, "show_as": {"type": "text", "index": 38, "name": "show_as", "comment": null}, "start_date_time": {"type": "timestamp without time zone", "index": 39, "name": "start_date_time", "comment": null}, "subject": {"type": "text", "index": 40, "name": "subject", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 41, "name": "system_modstamp", "comment": null}, "type": {"type": "text", "index": 42, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 43, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 44, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 45, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 46, "name": "who_id", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 47, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 48, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 49, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 50, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 52, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 53, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 54, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 55, "name": "lid_date_sent_c", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "is_recurrence_2": {"type": "boolean", "index": 78, "name": "is_recurrence_2", "comment": null}, "is_recurrence_2_exception": {"type": "boolean", "index": 79, "name": "is_recurrence_2_exception", "comment": null}, "is_recurrence_2_exclusion": {"type": "boolean", "index": 80, "name": "is_recurrence_2_exclusion", "comment": null}, "recurrence_2_pattern_start_date": {"type": "timestamp without time zone", "index": 81, "name": "recurrence_2_pattern_start_date", "comment": null}, "recurrence_2_pattern_text": {"type": "integer", "index": 82, "name": "recurrence_2_pattern_text", "comment": null}, "recurrence_2_pattern_time_zone": {"type": "integer", "index": 83, "name": "recurrence_2_pattern_time_zone", "comment": null}, "recurrence_2_pattern_version": {"type": "integer", "index": 84, "name": "recurrence_2_pattern_version", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 85, "name": "co_selling_activity_c", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 86, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 87, "name": "partner_contact_c", "comment": null}, "description_c": {"type": "integer", "index": 88, "name": "description_c", "comment": null}, "campaign_c": {"type": "integer", "index": 89, "name": "campaign_c", "comment": null}, "event_name_c": {"type": "integer", "index": 90, "name": "event_name_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 91, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 92, "name": "topic_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 93, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 94, "name": "partner_activity_type_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 95, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 96, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 97, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 98, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 99, "name": "vidyard_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 100, "name": "collections_hold_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 101, "name": "execute_collections_plan_activity_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 102, "name": "expected_payment_date_c", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 103, "name": "end_date", "comment": null}, "opportunity_c": {"type": "integer", "index": 104, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "integer", "index": 105, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "integer", "index": 106, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 107, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 108, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "integer", "index": 109, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "integer", "index": 110, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 111, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 112, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 113, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_event_data"}, "seed.salesforce_integration_tests.sf_lead_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"country": {"type": "integer", "index": 1, "name": "country", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 2, "name": "email_bounced_reason", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 3, "name": "email_bounced_date", "comment": null}, "owner_id": {"type": "text", "index": 4, "name": "owner_id", "comment": null}, "secondary_email_c": {"type": "integer", "index": 5, "name": "secondary_email_c", "comment": null}, "lead_source": {"type": "integer", "index": 6, "name": "lead_source", "comment": null}, "converted_date": {"type": "timestamp without time zone", "index": 7, "name": "converted_date", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": null}, "master_record_id": {"type": "integer", "index": 9, "name": "master_record_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 12, "name": "geocode_accuracy", "comment": null}, "converted_contact_id": {"type": "text", "index": 13, "name": "converted_contact_id", "comment": null}, "up_region_c": {"type": "integer", "index": 14, "name": "up_region_c", "comment": null}, "id": {"type": "text", "index": 15, "name": "id", "comment": null}, "photo_url": {"type": "text", "index": 16, "name": "photo_url", "comment": null}, "state": {"type": "integer", "index": 17, "name": "state", "comment": null}, "longitude": {"type": "integer", "index": 18, "name": "longitude", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 19, "name": "last_referenced_date", "comment": null}, "up_district_c": {"type": "integer", "index": 20, "name": "up_district_c", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "country_code": {"type": "integer", "index": 22, "name": "country_code", "comment": null}, "phone": {"type": "integer", "index": 23, "name": "phone", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 24, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 26, "name": "jigsaw_contact_id", "comment": null}, "lead_source_detail_c": {"type": "integer", "index": 27, "name": "lead_source_detail_c", "comment": null}, "created_by_id": {"type": "text", "index": 28, "name": "created_by_id", "comment": null}, "salutation": {"type": "integer", "index": 29, "name": "salutation", "comment": null}, "is_converted": {"type": "boolean", "index": 30, "name": "is_converted", "comment": null}, "state_code": {"type": "integer", "index": 31, "name": "state_code", "comment": null}, "is_unread_by_owner": {"type": "boolean", "index": 32, "name": "is_unread_by_owner", "comment": null}, "status": {"type": "text", "index": 33, "name": "status", "comment": null}, "city": {"type": "integer", "index": 34, "name": "city", "comment": null}, "latitude": {"type": "integer", "index": 35, "name": "latitude", "comment": null}, "cbit_clearbit_c": {"type": "integer", "index": 36, "name": "cbit_clearbit_c", "comment": null}, "industry": {"type": "text", "index": 37, "name": "industry", "comment": null}, "title": {"type": "integer", "index": 38, "name": "title", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 39, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 40, "name": "last_viewed_date", "comment": null}, "converted_opportunity_id": {"type": "integer", "index": 41, "name": "converted_opportunity_id", "comment": null}, "is_deleted": {"type": "boolean", "index": 42, "name": "is_deleted", "comment": null}, "street": {"type": "integer", "index": 43, "name": "street", "comment": null}, "company": {"type": "text", "index": 44, "name": "company", "comment": null}, "first_name": {"type": "text", "index": 45, "name": "first_name", "comment": null}, "email": {"type": "text", "index": 46, "name": "email", "comment": null}, "website": {"type": "integer", "index": 47, "name": "website", "comment": null}, "last_name": {"type": "text", "index": 48, "name": "last_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 49, "name": "number_of_employees", "comment": null}, "up_territory_c": {"type": "integer", "index": 50, "name": "up_territory_c", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 51, "name": "created_date", "comment": null}, "gclid_c": {"type": "integer", "index": 52, "name": "gclid_c", "comment": null}, "active_in_sequence_c": {"type": "boolean", "index": 53, "name": "active_in_sequence_c", "comment": null}, "postal_code": {"type": "integer", "index": 54, "name": "postal_code", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 55, "name": "cbit_clearbit_ready_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 56, "name": "has_opted_out_of_email", "comment": null}, "converted_account_id": {"type": "text", "index": 57, "name": "converted_account_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 58, "name": "mobile_phone", "comment": null}, "calendly_created_c": {"type": "integer", "index": 59, "name": "calendly_created_c", "comment": null}, "account_c": {"type": "integer", "index": 60, "name": "account_c", "comment": null}, "all_connectors_c": {"type": "integer", "index": 61, "name": "all_connectors_c", "comment": null}, "all_data_warehouses_c": {"type": "integer", "index": 62, "name": "all_data_warehouses_c", "comment": null}, "bi_tools_c": {"type": "integer", "index": 63, "name": "bi_tools_c", "comment": null}, "competitors_c": {"type": "integer", "index": 64, "name": "competitors_c", "comment": null}, "annual_revenue": {"type": "integer", "index": 65, "name": "annual_revenue", "comment": null}, "connectors_products_c": {"type": "integer", "index": 66, "name": "connectors_products_c", "comment": null}, "contact_c": {"type": "integer", "index": 67, "name": "contact_c", "comment": null}, "data_warehouse_products_c": {"type": "integer", "index": 68, "name": "data_warehouse_products_c", "comment": null}, "notes_c": {"type": "integer", "index": 69, "name": "notes_c", "comment": null}, "timeframe_c": {"type": "integer", "index": 70, "name": "timeframe_c", "comment": null}, "account_all_products_c": {"type": "integer", "index": 71, "name": "account_all_products_c", "comment": null}, "account_bi_tools_c": {"type": "integer", "index": 72, "name": "account_bi_tools_c", "comment": null}, "account_data_warehouses_c": {"type": "integer", "index": 73, "name": "account_data_warehouses_c", "comment": null}, "opportunity_competitors_c": {"type": "integer", "index": 74, "name": "opportunity_competitors_c", "comment": null}, "opportunity_products_c": {"type": "integer", "index": 75, "name": "opportunity_products_c", "comment": null}, "description": {"type": "integer", "index": 76, "name": "description", "comment": null}, "referral_account_c": {"type": "integer", "index": 77, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 78, "name": "referral_contact_c", "comment": null}, "volume_in_millions_c": {"type": "integer", "index": 79, "name": "volume_in_millions_c", "comment": null}, "feature_requests_c": {"type": "integer", "index": 80, "name": "feature_requests_c", "comment": null}, "lead_number_c": {"type": "integer", "index": 81, "name": "lead_number_c", "comment": null}, "demo_scheduled_by_calenderly_c": {"type": "boolean", "index": 82, "name": "demo_scheduled_by_calenderly_c", "comment": null}, "to_delete_c": {"type": "boolean", "index": 83, "name": "to_delete_c", "comment": null}, "bounced_email_c": {"type": "integer", "index": 84, "name": "bounced_email_c", "comment": null}, "email_quality_c": {"type": "boolean", "index": 85, "name": "email_quality_c", "comment": null}, "email_quality_catchall_c": {"type": "integer", "index": 86, "name": "email_quality_catchall_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 87, "name": "old_lead_source_c", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 88, "name": "email_bounced_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 89, "name": "old_lead_source_detail_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 90, "name": "utm_medium_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 91, "name": "utm_source_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 92, "name": "utm_campaign_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 93, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 94, "name": "utm_term_c", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 95, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 96, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 97, "name": "fivetran_user_id_c", "comment": null}, "geo_state_acton_c": {"type": "integer", "index": 98, "name": "geo_state_acton_c", "comment": null}, "actoncountry_c": {"type": "integer", "index": 99, "name": "actoncountry_c", "comment": null}, "actoncity_c": {"type": "integer", "index": 100, "name": "actoncity_c", "comment": null}, "actoncountrycode_c": {"type": "integer", "index": 101, "name": "actoncountrycode_c", "comment": null}, "actonpostalcode_c": {"type": "integer", "index": 102, "name": "actonpostalcode_c", "comment": null}, "actonreferrer_c": {"type": "integer", "index": 103, "name": "actonreferrer_c", "comment": null}, "actonstate_c": {"type": "integer", "index": 104, "name": "actonstate_c", "comment": null}, "geo_city_c": {"type": "integer", "index": 105, "name": "geo_city_c", "comment": null}, "geo_country_c": {"type": "integer", "index": 106, "name": "geo_country_c", "comment": null}, "geo_country_code_c": {"type": "integer", "index": 107, "name": "geo_country_code_c", "comment": null}, "geo_postal_code_c": {"type": "integer", "index": 108, "name": "geo_postal_code_c", "comment": null}, "geo_state_c": {"type": "integer", "index": 109, "name": "geo_state_c", "comment": null}, "company_type_c": {"type": "integer", "index": 110, "name": "company_type_c", "comment": null}, "pi_campaign_c": {"type": "integer", "index": 111, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 112, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 113, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 114, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 115, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "integer", "index": 116, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 117, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 118, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 119, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 120, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 121, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 122, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "integer", "index": 123, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 124, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "integer", "index": 125, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 126, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 127, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "integer", "index": 128, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 129, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 130, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 131, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 132, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 133, "name": "pi_utm_term_c", "comment": null}, "fax": {"type": "integer", "index": 134, "name": "fax", "comment": null}, "region_c": {"type": "integer", "index": 135, "name": "region_c", "comment": null}, "competitor_c": {"type": "boolean", "index": 136, "name": "competitor_c", "comment": null}, "source_detail_c": {"type": "integer", "index": 137, "name": "source_detail_c", "comment": null}, "fivetran_account_stage_c": {"type": "integer", "index": 138, "name": "fivetran_account_stage_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 139, "name": "fivetran_account_id_c", "comment": null}, "lean_data_router_status_c": {"type": "integer", "index": 140, "name": "lean_data_router_status_c", "comment": null}, "lean_data_matched_lead_c": {"type": "integer", "index": 141, "name": "lean_data_matched_lead_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 142, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_search_index_c": {"type": "text", "index": 143, "name": "lean_data_search_index_c", "comment": null}, "lean_data_reporting_matched_account_c": {"type": "text", "index": 144, "name": "lean_data_reporting_matched_account_c", "comment": null}, "lean_data_reporting_timestamp_c": {"type": "timestamp without time zone", "index": 145, "name": "lean_data_reporting_timestamp_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 146, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_marketing_sys_created_date_c": {"type": "integer", "index": 147, "name": "lean_data_marketing_sys_created_date_c", "comment": null}, "lean_data_matched_account_c": {"type": "integer", "index": 148, "name": "lean_data_matched_account_c", "comment": null}, "lean_data_a_2_b_account_c": {"type": "integer", "index": 149, "name": "lean_data_a_2_b_account_c", "comment": null}, "lean_data_search_c": {"type": "integer", "index": 150, "name": "lean_data_search_c", "comment": null}, "lean_data_routing_status_c": {"type": "text", "index": 151, "name": "lean_data_routing_status_c", "comment": null}, "lean_data_a_2_b_group_c": {"type": "integer", "index": 152, "name": "lean_data_a_2_b_group_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 153, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 154, "name": "lean_data_tag_c", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 155, "name": "lean_data_status_info_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 156, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 157, "name": "do_not_route_lead_c", "comment": null}, "partner_type_c": {"type": "integer", "index": 158, "name": "partner_type_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 159, "name": "allbound_id_c", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 160, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 161, "name": "lid_linked_in_member_token_c", "comment": null}, "lean_data_re_route_c": {"type": "integer", "index": 162, "name": "lean_data_re_route_c", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 163, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 164, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 165, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "network_c": {"type": "integer", "index": 166, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 167, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 168, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 169, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 170, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 171, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 172, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 173, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 174, "name": "partner_rep_name_c", "comment": null}, "lead_type_c": {"type": "integer", "index": 175, "name": "lead_type_c", "comment": null}, "contact_stage_c": {"type": "text", "index": 176, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 177, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 178, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 179, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 180, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 181, "name": "original_utm_term_c", "comment": null}, "es_app_esalexa_rank_c": {"type": "integer", "index": 182, "name": "es_app_esalexa_rank_c", "comment": null}, "es_app_esaudience_names_c": {"type": "integer", "index": 183, "name": "es_app_esaudience_names_c", "comment": null}, "es_app_escity_c": {"type": "integer", "index": 184, "name": "es_app_escity_c", "comment": null}, "es_app_escompany_phone_c": {"type": "integer", "index": 185, "name": "es_app_escompany_phone_c", "comment": null}, "es_app_escountry_c": {"type": "integer", "index": 186, "name": "es_app_escountry_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 187, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 188, "name": "es_app_esecid_c", "comment": null}, "es_app_esemployees_c": {"type": "integer", "index": 189, "name": "es_app_esemployees_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 190, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 191, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esfacebook_c": {"type": "integer", "index": 192, "name": "es_app_esfacebook_c", "comment": null}, "es_app_esindustry_c": {"type": "integer", "index": 193, "name": "es_app_esindustry_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 194, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 195, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 196, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_eskeywords_c": {"type": "integer", "index": 197, "name": "es_app_eskeywords_c", "comment": null}, "es_app_eslinked_in_c": {"type": "integer", "index": 198, "name": "es_app_eslinked_in_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 199, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_esrevenue_c": {"type": "integer", "index": 200, "name": "es_app_esrevenue_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 201, "name": "es_app_essource_c", "comment": null}, "es_app_esstate_c": {"type": "integer", "index": 202, "name": "es_app_esstate_c", "comment": null}, "es_app_esstreet_c": {"type": "integer", "index": 203, "name": "es_app_esstreet_c", "comment": null}, "es_app_estechnologies_c": {"type": "integer", "index": 204, "name": "es_app_estechnologies_c", "comment": null}, "es_app_estwitter_c": {"type": "integer", "index": 205, "name": "es_app_estwitter_c", "comment": null}, "es_app_eszipcode_c": {"type": "integer", "index": 206, "name": "es_app_eszipcode_c", "comment": null}, "marketing_prospect_routing_rules_c": {"type": "boolean", "index": 207, "name": "marketing_prospect_routing_rules_c", "comment": null}, "individual_id": {"type": "integer", "index": 208, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 209, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 210, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 211, "name": "user_gems_has_changed_job_c", "comment": null}, "user_gems_linked_in_c": {"type": "integer", "index": 212, "name": "user_gems_linked_in_c", "comment": null}, "email_opt_in_c": {"type": "integer", "index": 213, "name": "email_opt_in_c", "comment": null}, "email_opt_in_explicit_c": {"type": "boolean", "index": 214, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "boolean", "index": 215, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "boolean", "index": 216, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "boolean", "index": 217, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 218, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 219, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 220, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 221, "name": "user_gems_past_title_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 222, "name": "promotion_id_c", "comment": null}, "previous_customer_c": {"type": "integer", "index": 223, "name": "previous_customer_c", "comment": null}, "referral_contact_email_c": {"type": "integer", "index": 224, "name": "referral_contact_email_c", "comment": null}, "referral_firstname_c": {"type": "integer", "index": 225, "name": "referral_firstname_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 226, "name": "referral_last_name_c", "comment": null}, "mkto_71_lead_score_c": {"type": "integer", "index": 227, "name": "mkto_71_lead_score_c", "comment": null}, "mkto_71_acquisition_date_c": {"type": "integer", "index": 228, "name": "mkto_71_acquisition_date_c", "comment": null}, "mkto_71_acquisition_program_id_c": {"type": "integer", "index": 229, "name": "mkto_71_acquisition_program_id_c", "comment": null}, "mkto_acquisition_program_c": {"type": "integer", "index": 230, "name": "mkto_acquisition_program_c", "comment": null}, "mkto_71_inferred_city_c": {"type": "integer", "index": 231, "name": "mkto_71_inferred_city_c", "comment": null}, "mkto_71_inferred_company_c": {"type": "integer", "index": 232, "name": "mkto_71_inferred_company_c", "comment": null}, "mkto_71_inferred_country_c": {"type": "integer", "index": 233, "name": "mkto_71_inferred_country_c", "comment": null}, "mkto_71_inferred_metropolitan_area_c": {"type": "integer", "index": 234, "name": "mkto_71_inferred_metropolitan_area_c", "comment": null}, "mkto_71_inferred_phone_area_code_c": {"type": "integer", "index": 235, "name": "mkto_71_inferred_phone_area_code_c", "comment": null}, "mkto_71_inferred_postal_code_c": {"type": "integer", "index": 236, "name": "mkto_71_inferred_postal_code_c", "comment": null}, "mkto_71_inferred_state_region_c": {"type": "integer", "index": 237, "name": "mkto_71_inferred_state_region_c", "comment": null}, "mkto_71_original_referrer_c": {"type": "integer", "index": 238, "name": "mkto_71_original_referrer_c", "comment": null}, "mkto_71_original_search_engine_c": {"type": "integer", "index": 239, "name": "mkto_71_original_search_engine_c", "comment": null}, "mkto_71_original_search_phrase_c": {"type": "integer", "index": 240, "name": "mkto_71_original_search_phrase_c", "comment": null}, "mkto_71_original_source_info_c": {"type": "integer", "index": 241, "name": "mkto_71_original_source_info_c", "comment": null}, "mkto_71_original_source_type_c": {"type": "integer", "index": 242, "name": "mkto_71_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 243, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "timestamp without time zone", "index": 244, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "text", "index": 245, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "text", "index": 246, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "text", "index": 247, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_msicontact_id_c": {"type": "integer", "index": 248, "name": "mkto_si_msicontact_id_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 249, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 250, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 251, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ar_c": {"type": "integer", "index": 252, "name": "cloudingo_agent_ar_c", "comment": null}, "cloudingo_agent_ardi_c": {"type": "integer", "index": 253, "name": "cloudingo_agent_ardi_c", "comment": null}, "cloudingo_agent_as_c": {"type": "integer", "index": 254, "name": "cloudingo_agent_as_c", "comment": null}, "cloudingo_agent_atz_c": {"type": "integer", "index": 255, "name": "cloudingo_agent_atz_c", "comment": null}, "cloudingo_agent_av_c": {"type": "integer", "index": 256, "name": "cloudingo_agent_av_c", "comment": null}, "cloudingo_agent_les_c": {"type": "integer", "index": 257, "name": "cloudingo_agent_les_c", "comment": null}, "do_not_sync_marketo_c": {"type": "boolean", "index": 258, "name": "do_not_sync_marketo_c", "comment": null}, "source_every_utm_campaign_c": {"type": "integer", "index": 259, "name": "source_every_utm_campaign_c", "comment": null}, "source_every_utm_content_c": {"type": "integer", "index": 260, "name": "source_every_utm_content_c", "comment": null}, "source_every_utm_medium_c": {"type": "integer", "index": 261, "name": "source_every_utm_medium_c", "comment": null}, "source_every_utm_source_c": {"type": "integer", "index": 262, "name": "source_every_utm_source_c", "comment": null}, "source_every_utm_term_c": {"type": "integer", "index": 263, "name": "source_every_utm_term_c", "comment": null}, "source_first_utm_campaign_c": {"type": "integer", "index": 264, "name": "source_first_utm_campaign_c", "comment": null}, "source_first_utm_content_c": {"type": "integer", "index": 265, "name": "source_first_utm_content_c", "comment": null}, "source_first_utm_medium_c": {"type": "integer", "index": 266, "name": "source_first_utm_medium_c", "comment": null}, "source_first_utm_source_c": {"type": "integer", "index": 267, "name": "source_first_utm_source_c", "comment": null}, "source_first_utm_term_c": {"type": "integer", "index": 268, "name": "source_first_utm_term_c", "comment": null}, "source_last_utm_campaign_c": {"type": "text", "index": 269, "name": "source_last_utm_campaign_c", "comment": null}, "source_last_utm_content_c": {"type": "text", "index": 270, "name": "source_last_utm_content_c", "comment": null}, "source_last_utm_medium_c": {"type": "text", "index": 271, "name": "source_last_utm_medium_c", "comment": null}, "source_last_utm_source_c": {"type": "text", "index": 272, "name": "source_last_utm_source_c", "comment": null}, "source_last_utm_term_c": {"type": "text", "index": 273, "name": "source_last_utm_term_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 274, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 275, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 276, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 277, "name": "state_c", "comment": null}, "source_first_lead_source_category_c": {"type": "integer", "index": 278, "name": "source_first_lead_source_category_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 279, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 280, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 281, "name": "source_last_lead_source_detail_c", "comment": null}, "source_every_lead_source_c": {"type": "integer", "index": 282, "name": "source_every_lead_source_c", "comment": null}, "source_every_lead_source_category_c": {"type": "integer", "index": 283, "name": "source_every_lead_source_category_c", "comment": null}, "source_every_lead_source_detail_c": {"type": "integer", "index": 284, "name": "source_every_lead_source_detail_c", "comment": null}, "source_first_lead_source_c": {"type": "integer", "index": 285, "name": "source_first_lead_source_c", "comment": null}, "source_first_lead_source_detail_c": {"type": "integer", "index": 286, "name": "source_first_lead_source_detail_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 287, "name": "behavioral_score_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 288, "name": "demographic_score_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 289, "name": "drift_cql_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 290, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "boolean", "index": 291, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 292, "name": "csi_code_c", "comment": null}, "csi_description_c": {"type": "text", "index": 293, "name": "csi_description_c", "comment": null}, "converted_date_time_c": {"type": "timestamp without time zone", "index": 294, "name": "converted_date_time_c", "comment": null}, "lead_created_date_time_reporting_c": {"type": "timestamp without time zone", "index": 295, "name": "lead_created_date_time_reporting_c", "comment": null}, "lead_iq_country_c": {"type": "integer", "index": 296, "name": "lead_iq_country_c", "comment": null}, "lead_iq_employee_count_c": {"type": "integer", "index": 297, "name": "lead_iq_employee_count_c", "comment": null}, "lead_iq_employee_range_c": {"type": "integer", "index": 298, "name": "lead_iq_employee_range_c", "comment": null}, "lead_iq_state_c": {"type": "integer", "index": 299, "name": "lead_iq_state_c", "comment": null}, "lead_iq_zip_code_c": {"type": "integer", "index": 300, "name": "lead_iq_zip_code_c", "comment": null}, "zoominfo_country_c": {"type": "integer", "index": 301, "name": "zoominfo_country_c", "comment": null}, "zoominfo_employee_count_c": {"type": "integer", "index": 302, "name": "zoominfo_employee_count_c", "comment": null}, "zoominfo_state_c": {"type": "integer", "index": 303, "name": "zoominfo_state_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 304, "name": "zoominfo_technologies_c", "comment": null}, "zoominfo_zip_code_c": {"type": "integer", "index": 305, "name": "zoominfo_zip_code_c", "comment": null}, "attended_event_c": {"type": "boolean", "index": 306, "name": "attended_event_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 307, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 308, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 309, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 310, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 311, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 312, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "boolean", "index": 313, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 314, "name": "first_mql_date_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 315, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 316, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "text", "index": 317, "name": "mql_reason_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 318, "name": "trial_contact_start_date_c", "comment": null}, "enrichment_request_c": {"type": "boolean", "index": 319, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "timestamp without time zone", "index": 320, "name": "meta_data_create_date_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 321, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 322, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 323, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 324, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 325, "name": "clarus_status_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 326, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 327, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 328, "name": "salesloft_cadence_trigger_c", "comment": null}, "datawarehouse_used_c": {"type": "integer", "index": 329, "name": "datawarehouse_used_c", "comment": null}, "contact_status_c": {"type": "integer", "index": 330, "name": "contact_status_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 331, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "text", "index": 332, "name": "potential_fivetran_use_case_c", "comment": null}, "bizible_2_account_c": {"type": "integer", "index": 333, "name": "bizible_2_account_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 334, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 335, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 336, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 337, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 338, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 339, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 340, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 341, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 342, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 343, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 344, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "boolean", "index": 345, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 346, "name": "sales_email_opt_out_date_time_c", "comment": null}, "bombora_app_bombora_surge_record_count_c": {"type": "integer", "index": 347, "name": "bombora_app_bombora_surge_record_count_c", "comment": null}, "bombora_app_bombora_last_date_time_updated_c": {"type": "integer", "index": 348, "name": "bombora_app_bombora_last_date_time_updated_c", "comment": null}, "bombora_app_bombora_total_composite_score_c": {"type": "integer", "index": 349, "name": "bombora_app_bombora_total_composite_score_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 350, "name": "linked_in_url_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 351, "name": "beta_connector_interest_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 352, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 353, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "boolean", "index": 354, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 355, "name": "free_trial_email_confirmed_date_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 356, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "dnboptimizer_dn_bcompany_record_c": {"type": "integer", "index": 357, "name": "dnboptimizer_dn_bcompany_record_c", "comment": null}, "dnboptimizer_dnb_d_u_n_s_number_c": {"type": "integer", "index": 358, "name": "dnboptimizer_dnb_d_u_n_s_number_c", "comment": null}, "i_sell_oskey_id_c": {"type": "integer", "index": 359, "name": "i_sell_oskey_id_c", "comment": null}, "verified_c": {"type": "boolean", "index": 360, "name": "verified_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 361, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_c": {"type": "integer", "index": 362, "name": "pbf_startup_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "boolean", "index": 363, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 364, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 365, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 366, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_matched_account_c": {"type": "integer", "index": 367, "name": "engagio_matched_account_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 368, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_match_time_c": {"type": "integer", "index": 369, "name": "engagio_match_time_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 370, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 371, "name": "engagio_role_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 372, "name": "legacy_hvr_id_c", "comment": null}, "hvr_channel_c": {"type": "integer", "index": 373, "name": "hvr_channel_c", "comment": null}, "email_opt_in_double_c": {"type": "boolean", "index": 374, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 375, "name": "phone_number_catch_all_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 376, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 377, "name": "utm_id_c", "comment": null}, "source_every_utm_id_c": {"type": "integer", "index": 378, "name": "source_every_utm_id_c", "comment": null}, "source_last_utm_id_c": {"type": "integer", "index": 379, "name": "source_last_utm_id_c", "comment": null}, "source_first_utm_id_c": {"type": "integer", "index": 380, "name": "source_first_utm_id_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 381, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 382, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_lead_data"}, "seed.salesforce_integration_tests.sf_opportunity_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 7, "name": "description", "comment": null}, "expected_revenue": {"type": "integer", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_excluded_from_territory_2_filter": {"type": "integer", "index": 20, "name": "is_excluded_from_territory_2_filter", "comment": null}, "is_won": {"type": "boolean", "index": 21, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 22, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 25, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 27, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 29, "name": "pricebook_2_id", "comment": null}, "probability": {"type": "double precision", "index": 30, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 32, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 33, "name": "synced_quote_id", "comment": null}, "territory_2_id": {"type": "integer", "index": 34, "name": "territory_2_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 36, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_opportunity_data"}, "seed.salesforce_integration_tests.sf_opportunity_history_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 5, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 6, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 7, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 8, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 9, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 10, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 11, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 12, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 13, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 14, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 15, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 16, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 17, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 18, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 19, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 21, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 22, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 23, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 24, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 25, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 26, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 27, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 29, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 30, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 31, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 32, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 33, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 34, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}}, "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.salesforce_integration_tests.sf_opportunity_history_data"}, "seed.salesforce_integration_tests.sf_opportunity_line_item_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"product_2_id": {"type": "text", "index": 1, "name": "product_2_id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "total_price": {"type": "double precision", "index": 3, "name": "total_price", "comment": null}, "description": {"type": "integer", "index": 4, "name": "description", "comment": null}, "discount": {"type": "integer", "index": 5, "name": "discount", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 6, "name": "last_modified_date", "comment": null}, "list_price": {"type": "integer", "index": 7, "name": "list_price", "comment": null}, "product_code": {"type": "text", "index": 8, "name": "product_code", "comment": null}, "unit_price": {"type": "double precision", "index": 9, "name": "unit_price", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "opportunity_id": {"type": "text", "index": 12, "name": "opportunity_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 14, "name": "service_date", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 15, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 16, "name": "name", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "sort_order": {"type": "integer", "index": 20, "name": "sort_order", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 21, "name": "pricebook_entry_id", "comment": null}, "one_saas_app_included_c": {"type": "integer", "index": 22, "name": "one_saas_app_included_c", "comment": null}, "one_saas_app_quantity_invoiced_c": {"type": "integer", "index": 23, "name": "one_saas_app_quantity_invoiced_c", "comment": null}, "one_saas_app_quantity_not_invoiced_c": {"type": "integer", "index": 24, "name": "one_saas_app_quantity_not_invoiced_c", "comment": null}, "has_quantity_schedule": {"type": "integer", "index": 25, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "integer", "index": 26, "name": "has_revenue_schedule", "comment": null}, "has_schedule": {"type": "integer", "index": 27, "name": "has_schedule", "comment": null}, "event_volume_c": {"type": "integer", "index": 28, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 29, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 30, "name": "row_volume_c", "comment": null}, "months_c": {"type": "integer", "index": 31, "name": "months_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 32, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_discount_item_c": {"type": "integer", "index": 33, "name": "netsuite_conn_discount_item_c", "comment": null}, "netsuite_conn_user_entered_sales_price_c": {"type": "integer", "index": 34, "name": "netsuite_conn_user_entered_sales_price_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 35, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_terms_c": {"type": "integer", "index": 36, "name": "netsuite_conn_terms_c", "comment": null}, "netsuite_conn_net_suite_item_key_id_c": {"type": "integer", "index": 37, "name": "netsuite_conn_net_suite_item_key_id_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 38, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_end_date_c": {"type": "integer", "index": 39, "name": "netsuite_conn_end_date_c", "comment": null}, "netsuite_conn_list_rate_c": {"type": "integer", "index": 40, "name": "netsuite_conn_list_rate_c", "comment": null}, "netsuite_conn_from_contract_item_id_c": {"type": "integer", "index": 41, "name": "netsuite_conn_from_contract_item_id_c", "comment": null}, "netsuite_conn_start_date_c": {"type": "integer", "index": 42, "name": "netsuite_conn_start_date_c", "comment": null}, "netsuite_conn_net_suite_item_id_import_c": {"type": "integer", "index": 43, "name": "netsuite_conn_net_suite_item_id_import_c", "comment": null}, "sbqq_parent_id_c": {"type": "text", "index": 44, "name": "sbqq_parent_id_c", "comment": null}, "sbqq_quote_line_c": {"type": "text", "index": 45, "name": "sbqq_quote_line_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 46, "name": "sbqq_subscription_type_c", "comment": null}, "product_family_c": {"type": "text", "index": 47, "name": "product_family_c", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 48, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 49, "name": "last_viewed_date", "comment": null}, "celigo_sfnsio_contract_item_id_c": {"type": "integer", "index": 50, "name": "celigo_sfnsio_contract_item_id_c", "comment": null}, "celigo_sfnsio_contract_term_c": {"type": "integer", "index": 51, "name": "celigo_sfnsio_contract_term_c", "comment": null}, "celigo_sfnsio_end_date_c": {"type": "integer", "index": 52, "name": "celigo_sfnsio_end_date_c", "comment": null}, "celigo_sfnsio_list_rate_c": {"type": "integer", "index": 53, "name": "celigo_sfnsio_list_rate_c", "comment": null}, "celigo_sfnsio_net_suite_line_id_c": {"type": "integer", "index": 54, "name": "celigo_sfnsio_net_suite_line_id_c", "comment": null}, "celigo_sfnsio_start_date_c": {"type": "integer", "index": 55, "name": "celigo_sfnsio_start_date_c", "comment": null}, "product_code_stamped_c": {"type": "integer", "index": 56, "name": "product_code_stamped_c", "comment": null}, "hvr_use_case_c": {"type": "boolean", "index": 57, "name": "hvr_use_case_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 58, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_opportunity_line_item_data"}, "seed.salesforce_integration_tests.sf_order_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": null}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": null}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "integer", "index": 8, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 9, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "integer", "index": 10, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "integer", "index": 11, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 12, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 13, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "integer", "index": 14, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": null}, "company_authorized_by_id": {"type": "integer", "index": 16, "name": "company_authorized_by_id", "comment": null}, "contract_id": {"type": "integer", "index": 17, "name": "contract_id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "customer_authorized_by_id": {"type": "integer", "index": 20, "name": "customer_authorized_by_id", "comment": null}, "description": {"type": "integer", "index": 21, "name": "description", "comment": null}, "effective_date": {"type": "timestamp without time zone", "index": 22, "name": "effective_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 23, "name": "end_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": null}, "is_reduction_order": {"type": "boolean", "index": 25, "name": "is_reduction_order", "comment": null}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 28, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 29, "name": "last_viewed_date", "comment": null}, "order_number": {"type": "integer", "index": 30, "name": "order_number", "comment": null}, "original_order_id": {"type": "integer", "index": 31, "name": "original_order_id", "comment": null}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 33, "name": "pricebook_2_id", "comment": null}, "shipping_city": {"type": "text", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "integer", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "integer", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "integer", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 43, "name": "shipping_street", "comment": null}, "status": {"type": "text", "index": 44, "name": "status", "comment": null}, "status_code": {"type": "text", "index": 45, "name": "status_code", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 46, "name": "system_modstamp", "comment": null}, "total_amount": {"type": "double precision", "index": 47, "name": "total_amount", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 49, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_opportunity_c": {"type": "integer", "index": 53, "name": "netsuite_conn_opportunity_c", "comment": null}, "netsuite_conn_net_suite_order_status_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_order_status_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 55, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_tax_total_c": {"type": "integer", "index": 56, "name": "netsuite_conn_tax_total_c", "comment": null}, "netsuite_conn_tracking_numbers_c": {"type": "integer", "index": 57, "name": "netsuite_conn_tracking_numbers_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 58, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_document_id_c": {"type": "integer", "index": 59, "name": "netsuite_conn_document_id_c", "comment": null}, "netsuite_conn_subtotal_c": {"type": "integer", "index": 60, "name": "netsuite_conn_subtotal_c", "comment": null}, "netsuite_conn_discount_total_c": {"type": "integer", "index": 61, "name": "netsuite_conn_discount_total_c", "comment": null}, "netsuite_conn_total_c": {"type": "integer", "index": 62, "name": "netsuite_conn_total_c", "comment": null}, "netsuite_conn_net_suite_order_date_c": {"type": "timestamp without time zone", "index": 63, "name": "netsuite_conn_net_suite_order_date_c", "comment": null}, "netsuite_conn_ship_date_c": {"type": "integer", "index": 64, "name": "netsuite_conn_ship_date_c", "comment": null}, "netsuite_conn_quote_c": {"type": "integer", "index": 65, "name": "netsuite_conn_quote_c", "comment": null}, "netsuite_conn_net_suite_order_number_c": {"type": "text", "index": 66, "name": "netsuite_conn_net_suite_order_number_c", "comment": null}, "sbqq_contracted_c": {"type": "boolean", "index": 67, "name": "sbqq_contracted_c", "comment": null}, "sbqq_contracting_method_c": {"type": "text", "index": 68, "name": "sbqq_contracting_method_c", "comment": null}, "sbqq_payment_term_c": {"type": "text", "index": 69, "name": "sbqq_payment_term_c", "comment": null}, "sbqq_price_calc_status_c": {"type": "text", "index": 70, "name": "sbqq_price_calc_status_c", "comment": null}, "sbqq_price_calc_status_message_c": {"type": "integer", "index": 71, "name": "sbqq_price_calc_status_message_c", "comment": null}, "sbqq_quote_c": {"type": "text", "index": 72, "name": "sbqq_quote_c", "comment": null}, "sbqq_renewal_term_c": {"type": "integer", "index": 73, "name": "sbqq_renewal_term_c", "comment": null}, "sbqq_renewal_uplift_rate_c": {"type": "integer", "index": 74, "name": "sbqq_renewal_uplift_rate_c", "comment": null}, "ava_sfcpq_ava_tax_message_c": {"type": "text", "index": 75, "name": "ava_sfcpq_ava_tax_message_c", "comment": null}, "ava_sfcpq_entity_use_code_c": {"type": "integer", "index": 76, "name": "ava_sfcpq_entity_use_code_c", "comment": null}, "ava_sfcpq_invoice_message_c": {"type": "integer", "index": 77, "name": "ava_sfcpq_invoice_message_c", "comment": null}, "ava_sfcpq_is_seller_importer_of_record_c": {"type": "boolean", "index": 78, "name": "ava_sfcpq_is_seller_importer_of_record_c", "comment": null}, "ava_sfcpq_order_calculate_tax_c": {"type": "boolean", "index": 79, "name": "ava_sfcpq_order_calculate_tax_c", "comment": null}, "ava_sfcpq_sales_tax_amount_c": {"type": "integer", "index": 80, "name": "ava_sfcpq_sales_tax_amount_c", "comment": null}, "blng_bill_now_c": {"type": "boolean", "index": 81, "name": "blng_bill_now_c", "comment": null}, "blng_billing_account_c": {"type": "text", "index": 82, "name": "blng_billing_account_c", "comment": null}, "blng_billing_day_of_month_c": {"type": "integer", "index": 83, "name": "blng_billing_day_of_month_c", "comment": null}, "blng_invoice_batch_c": {"type": "text", "index": 84, "name": "blng_invoice_batch_c", "comment": null}, "amendment_type_c": {"type": "integer", "index": 85, "name": "amendment_type_c", "comment": null}, "credit_summary_c": {"type": "text", "index": 86, "name": "credit_summary_c", "comment": null}, "evergreen_c": {"type": "boolean", "index": 87, "name": "evergreen_c", "comment": null}, "invoicing_type_c": {"type": "text", "index": 88, "name": "invoicing_type_c", "comment": null}, "legal_entity_c": {"type": "text", "index": 89, "name": "legal_entity_c", "comment": null}, "prepaid_billing_frequency_c": {"type": "text", "index": 90, "name": "prepaid_billing_frequency_c", "comment": null}, "prepaid_order_c": {"type": "boolean", "index": 91, "name": "prepaid_order_c", "comment": null}, "update_subscriptions_only_c": {"type": "boolean", "index": 92, "name": "update_subscriptions_only_c", "comment": null}, "order_auto_activated_c": {"type": "boolean", "index": 93, "name": "order_auto_activated_c", "comment": null}, "synced_to_net_suite_c": {"type": "boolean", "index": 94, "name": "synced_to_net_suite_c", "comment": null}, "purchase_order_number_c": {"type": "integer", "index": 95, "name": "purchase_order_number_c", "comment": null}, "celigo_sfnsio_discount_total_net_suite_c": {"type": "integer", "index": 96, "name": "celigo_sfnsio_discount_total_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 97, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_order_number_c": {"type": "text", "index": 98, "name": "celigo_sfnsio_net_suite_order_number_c", "comment": null}, "celigo_sfnsio_net_suite_order_status_c": {"type": "integer", "index": 99, "name": "celigo_sfnsio_net_suite_order_status_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "text", "index": 100, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_ship_date_c": {"type": "integer", "index": 101, "name": "celigo_sfnsio_ship_date_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 102, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_sub_total_net_suite_c": {"type": "integer", "index": 103, "name": "celigo_sfnsio_sub_total_net_suite_c", "comment": null}, "celigo_sfnsio_tax_total_net_suite_c": {"type": "integer", "index": 104, "name": "celigo_sfnsio_tax_total_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 105, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_total_net_suite_c": {"type": "integer", "index": 106, "name": "celigo_sfnsio_total_net_suite_c", "comment": null}, "amend_with_rollover_spend_type_c": {"type": "boolean", "index": 107, "name": "amend_with_rollover_spend_type_c", "comment": null}, "customer_spend_type_c": {"type": "integer", "index": 108, "name": "customer_spend_type_c", "comment": null}, "order_spend_type_c": {"type": "integer", "index": 109, "name": "order_spend_type_c", "comment": null}, "opportunity_id": {"type": "integer", "index": 110, "name": "opportunity_id", "comment": null}, "purchase_summary_c": {"type": "integer", "index": 111, "name": "purchase_summary_c", "comment": null}, "is_hvr_legacy_order_c": {"type": "integer", "index": 112, "name": "is_hvr_legacy_order_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 113, "name": "ironclad_workflow_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 114, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_order_data"}, "seed.salesforce_integration_tests.sf_product_2_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"last_referenced_date": {"type": "timestamp without time zone", "index": 1, "name": "last_referenced_date", "comment": null}, "is_active": {"type": "boolean", "index": 2, "name": "is_active", "comment": null}, "description": {"type": "integer", "index": 3, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 4, "name": "last_modified_date", "comment": null}, "record_type_id": {"type": "text", "index": 5, "name": "record_type_id", "comment": null}, "product_code": {"type": "integer", "index": 6, "name": "product_code", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 8, "name": "last_viewed_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 12, "name": "name", "comment": null}, "id": {"type": "text", "index": 13, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": null}, "family": {"type": "text", "index": 16, "name": "family", "comment": null}, "max_volume_c": {"type": "integer", "index": 17, "name": "max_volume_c", "comment": null}, "min_volume_c": {"type": "integer", "index": 18, "name": "min_volume_c", "comment": null}, "request_name_c": {"type": "integer", "index": 19, "name": "request_name_c", "comment": null}, "default_quantity_c": {"type": "integer", "index": 20, "name": "default_quantity_c", "comment": null}, "account_c": {"type": "integer", "index": 21, "name": "account_c", "comment": null}, "related_product_c": {"type": "integer", "index": 22, "name": "related_product_c", "comment": null}, "picklist_value_c": {"type": "integer", "index": 23, "name": "picklist_value_c", "comment": null}, "as_input_c": {"type": "integer", "index": 24, "name": "as_input_c", "comment": null}, "as_output_c": {"type": "integer", "index": 25, "name": "as_output_c", "comment": null}, "status_c": {"type": "integer", "index": 26, "name": "status_c", "comment": null}, "number_of_quantity_installments": {"type": "integer", "index": 27, "name": "number_of_quantity_installments", "comment": null}, "number_of_revenue_installments": {"type": "integer", "index": 28, "name": "number_of_revenue_installments", "comment": null}, "quantity_installment_period": {"type": "integer", "index": 29, "name": "quantity_installment_period", "comment": null}, "quantity_schedule_type": {"type": "integer", "index": 30, "name": "quantity_schedule_type", "comment": null}, "revenue_installment_period": {"type": "integer", "index": 31, "name": "revenue_installment_period", "comment": null}, "revenue_schedule_type": {"type": "integer", "index": 32, "name": "revenue_schedule_type", "comment": null}, "connections_c": {"type": "integer", "index": 33, "name": "connections_c", "comment": null}, "event_volume_c": {"type": "integer", "index": 34, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 35, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 36, "name": "row_volume_c", "comment": null}, "display_url": {"type": "integer", "index": 37, "name": "display_url", "comment": null}, "external_data_source_id": {"type": "integer", "index": 38, "name": "external_data_source_id", "comment": null}, "external_id": {"type": "integer", "index": 39, "name": "external_id", "comment": null}, "quantity_unit_of_measure": {"type": "integer", "index": 40, "name": "quantity_unit_of_measure", "comment": null}, "stock_keeping_unit": {"type": "integer", "index": 41, "name": "stock_keeping_unit", "comment": null}, "features_c": {"type": "integer", "index": 42, "name": "features_c", "comment": null}, "tier_3_price_c": {"type": "integer", "index": 43, "name": "tier_3_price_c", "comment": null}, "tier_2_price_c": {"type": "integer", "index": 44, "name": "tier_2_price_c", "comment": null}, "tier_4_price_c": {"type": "integer", "index": 45, "name": "tier_4_price_c", "comment": null}, "tier_1_price_c": {"type": "integer", "index": 46, "name": "tier_1_price_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 47, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 48, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 49, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "text", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 53, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_net_suite_item_type_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_item_type_c", "comment": null}, "netsuite_conn_sub_type_c": {"type": "text", "index": 55, "name": "netsuite_conn_sub_type_c", "comment": null}, "is_new_c": {"type": "boolean", "index": 56, "name": "is_new_c", "comment": null}, "product_metadata_c": {"type": "integer", "index": 57, "name": "product_metadata_c", "comment": null}, "product_metadata_del_c": {"type": "integer", "index": 58, "name": "product_metadata_del_c", "comment": null}, "sbqq_asset_amendment_behavior_c": {"type": "text", "index": 59, "name": "sbqq_asset_amendment_behavior_c", "comment": null}, "sbqq_asset_conversion_c": {"type": "text", "index": 60, "name": "sbqq_asset_conversion_c", "comment": null}, "sbqq_batch_quantity_c": {"type": "integer", "index": 61, "name": "sbqq_batch_quantity_c", "comment": null}, "sbqq_billing_frequency_c": {"type": "text", "index": 62, "name": "sbqq_billing_frequency_c", "comment": null}, "sbqq_billing_type_c": {"type": "text", "index": 63, "name": "sbqq_billing_type_c", "comment": null}, "sbqq_block_pricing_field_c": {"type": "text", "index": 64, "name": "sbqq_block_pricing_field_c", "comment": null}, "sbqq_charge_type_c": {"type": "text", "index": 65, "name": "sbqq_charge_type_c", "comment": null}, "sbqq_component_c": {"type": "boolean", "index": 66, "name": "sbqq_component_c", "comment": null}, "sbqq_compound_discount_rate_c": {"type": "integer", "index": 67, "name": "sbqq_compound_discount_rate_c", "comment": null}, "sbqq_configuration_event_c": {"type": "integer", "index": 68, "name": "sbqq_configuration_event_c", "comment": null}, "sbqq_configuration_field_set_c": {"type": "integer", "index": 69, "name": "sbqq_configuration_field_set_c", "comment": null}, "sbqq_configuration_fields_c": {"type": "integer", "index": 70, "name": "sbqq_configuration_fields_c", "comment": null}, "sbqq_configuration_form_title_c": {"type": "integer", "index": 71, "name": "sbqq_configuration_form_title_c", "comment": null}, "sbqq_configuration_type_c": {"type": "integer", "index": 72, "name": "sbqq_configuration_type_c", "comment": null}, "sbqq_configuration_validator_c": {"type": "integer", "index": 73, "name": "sbqq_configuration_validator_c", "comment": null}, "sbqq_configured_code_pattern_c": {"type": "integer", "index": 74, "name": "sbqq_configured_code_pattern_c", "comment": null}, "sbqq_configured_description_pattern_c": {"type": "integer", "index": 75, "name": "sbqq_configured_description_pattern_c", "comment": null}, "sbqq_cost_editable_c": {"type": "boolean", "index": 76, "name": "sbqq_cost_editable_c", "comment": null}, "sbqq_cost_schedule_c": {"type": "integer", "index": 77, "name": "sbqq_cost_schedule_c", "comment": null}, "sbqq_custom_configuration_page_c": {"type": "integer", "index": 78, "name": "sbqq_custom_configuration_page_c", "comment": null}, "sbqq_custom_configuration_required_c": {"type": "boolean", "index": 79, "name": "sbqq_custom_configuration_required_c", "comment": null}, "sbqq_customer_community_availability_c": {"type": "integer", "index": 80, "name": "sbqq_customer_community_availability_c", "comment": null}, "sbqq_default_pricing_table_c": {"type": "integer", "index": 81, "name": "sbqq_default_pricing_table_c", "comment": null}, "sbqq_default_quantity_c": {"type": "integer", "index": 82, "name": "sbqq_default_quantity_c", "comment": null}, "sbqq_description_locked_c": {"type": "boolean", "index": 83, "name": "sbqq_description_locked_c", "comment": null}, "sbqq_discount_category_c": {"type": "integer", "index": 84, "name": "sbqq_discount_category_c", "comment": null}, "sbqq_discount_schedule_c": {"type": "integer", "index": 85, "name": "sbqq_discount_schedule_c", "comment": null}, "sbqq_dynamic_pricing_constraint_c": {"type": "integer", "index": 86, "name": "sbqq_dynamic_pricing_constraint_c", "comment": null}, "sbqq_exclude_from_maintenance_c": {"type": "boolean", "index": 87, "name": "sbqq_exclude_from_maintenance_c", "comment": null}, "sbqq_exclude_from_opportunity_c": {"type": "boolean", "index": 88, "name": "sbqq_exclude_from_opportunity_c", "comment": null}, "sbqq_externally_configurable_c": {"type": "boolean", "index": 89, "name": "sbqq_externally_configurable_c", "comment": null}, "sbqq_generate_contracted_price_c": {"type": "integer", "index": 90, "name": "sbqq_generate_contracted_price_c", "comment": null}, "sbqq_has_configuration_attributes_c": {"type": "boolean", "index": 91, "name": "sbqq_has_configuration_attributes_c", "comment": null}, "sbqq_has_consumption_schedule_c": {"type": "boolean", "index": 92, "name": "sbqq_has_consumption_schedule_c", "comment": null}, "sbqq_hidden_c": {"type": "boolean", "index": 93, "name": "sbqq_hidden_c", "comment": null}, "sbqq_hide_price_in_search_results_c": {"type": "boolean", "index": 94, "name": "sbqq_hide_price_in_search_results_c", "comment": null}, "sbqq_include_in_maintenance_c": {"type": "boolean", "index": 95, "name": "sbqq_include_in_maintenance_c", "comment": null}, "sbqq_new_quote_group_c": {"type": "boolean", "index": 96, "name": "sbqq_new_quote_group_c", "comment": null}, "sbqq_non_discountable_c": {"type": "boolean", "index": 97, "name": "sbqq_non_discountable_c", "comment": null}, "sbqq_non_partner_discountable_c": {"type": "boolean", "index": 98, "name": "sbqq_non_partner_discountable_c", "comment": null}, "sbqq_option_layout_c": {"type": "integer", "index": 99, "name": "sbqq_option_layout_c", "comment": null}, "sbqq_option_selection_method_c": {"type": "text", "index": 100, "name": "sbqq_option_selection_method_c", "comment": null}, "sbqq_optional_c": {"type": "boolean", "index": 101, "name": "sbqq_optional_c", "comment": null}, "sbqq_price_editable_c": {"type": "boolean", "index": 102, "name": "sbqq_price_editable_c", "comment": null}, "sbqq_pricing_method_c": {"type": "text", "index": 103, "name": "sbqq_pricing_method_c", "comment": null}, "sbqq_pricing_method_editable_c": {"type": "boolean", "index": 104, "name": "sbqq_pricing_method_editable_c", "comment": null}, "sbqq_product_picture_id_c": {"type": "integer", "index": 105, "name": "sbqq_product_picture_id_c", "comment": null}, "sbqq_quantity_editable_c": {"type": "boolean", "index": 106, "name": "sbqq_quantity_editable_c", "comment": null}, "sbqq_quantity_scale_c": {"type": "integer", "index": 107, "name": "sbqq_quantity_scale_c", "comment": null}, "sbqq_reconfiguration_disabled_c": {"type": "boolean", "index": 108, "name": "sbqq_reconfiguration_disabled_c", "comment": null}, "sbqq_renewal_product_c": {"type": "integer", "index": 109, "name": "sbqq_renewal_product_c", "comment": null}, "sbqq_sort_order_c": {"type": "integer", "index": 110, "name": "sbqq_sort_order_c", "comment": null}, "sbqq_specifications_c": {"type": "integer", "index": 111, "name": "sbqq_specifications_c", "comment": null}, "sbqq_subscription_base_c": {"type": "text", "index": 112, "name": "sbqq_subscription_base_c", "comment": null}, "sbqq_subscription_category_c": {"type": "integer", "index": 113, "name": "sbqq_subscription_category_c", "comment": null}, "sbqq_subscription_percent_c": {"type": "integer", "index": 114, "name": "sbqq_subscription_percent_c", "comment": null}, "sbqq_subscription_pricing_c": {"type": "text", "index": 115, "name": "sbqq_subscription_pricing_c", "comment": null}, "sbqq_subscription_target_c": {"type": "integer", "index": 116, "name": "sbqq_subscription_target_c", "comment": null}, "sbqq_subscription_term_c": {"type": "integer", "index": 117, "name": "sbqq_subscription_term_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 118, "name": "sbqq_subscription_type_c", "comment": null}, "sbqq_tax_code_c": {"type": "integer", "index": 119, "name": "sbqq_tax_code_c", "comment": null}, "sbqq_taxable_c": {"type": "boolean", "index": 120, "name": "sbqq_taxable_c", "comment": null}, "sbqq_term_discount_level_c": {"type": "integer", "index": 121, "name": "sbqq_term_discount_level_c", "comment": null}, "sbqq_term_discount_schedule_c": {"type": "integer", "index": 122, "name": "sbqq_term_discount_schedule_c", "comment": null}, "sbqq_upgrade_credit_c": {"type": "integer", "index": 123, "name": "sbqq_upgrade_credit_c", "comment": null}, "sbqq_upgrade_ratio_c": {"type": "integer", "index": 124, "name": "sbqq_upgrade_ratio_c", "comment": null}, "sbqq_upgrade_source_c": {"type": "integer", "index": 125, "name": "sbqq_upgrade_source_c", "comment": null}, "sbqq_upgrade_target_c": {"type": "integer", "index": 126, "name": "sbqq_upgrade_target_c", "comment": null}, "connector_type_c": {"type": "text", "index": 127, "name": "connector_type_c", "comment": null}, "pbf_pro_type_discount_c": {"type": "boolean", "index": 128, "name": "pbf_pro_type_discount_c", "comment": null}, "dimension_c": {"type": "text", "index": 129, "name": "dimension_c", "comment": null}, "connector_status_c": {"type": "text", "index": 130, "name": "connector_status_c", "comment": null}, "dimension_definition_c": {"type": "integer", "index": 131, "name": "dimension_definition_c", "comment": null}, "ava_sfcpq_tax_code_c": {"type": "integer", "index": 132, "name": "ava_sfcpq_tax_code_c", "comment": null}, "paid_consumption_c": {"type": "integer", "index": 133, "name": "paid_consumption_c", "comment": null}, "is_complimentary_c": {"type": "boolean", "index": 134, "name": "is_complimentary_c", "comment": null}, "product_external_id_c": {"type": "integer", "index": 135, "name": "product_external_id_c", "comment": null}, "blng_billing_rule_c": {"type": "text", "index": 136, "name": "blng_billing_rule_c", "comment": null}, "blng_revenue_recognition_rule_c": {"type": "text", "index": 137, "name": "blng_revenue_recognition_rule_c", "comment": null}, "blng_tax_rule_c": {"type": "text", "index": 138, "name": "blng_tax_rule_c", "comment": null}, "deployment_date_c": {"type": "integer", "index": 139, "name": "deployment_date_c", "comment": null}, "do_not_prorate_c": {"type": "boolean", "index": 140, "name": "do_not_prorate_c", "comment": null}, "celigo_sfnsio_netsuite_id_c": {"type": "integer", "index": 141, "name": "celigo_sfnsio_netsuite_id_c", "comment": null}, "sbqq_enable_large_configuration_c": {"type": "boolean", "index": 142, "name": "sbqq_enable_large_configuration_c", "comment": null}, "sbqq_pricing_guidance_c": {"type": "integer", "index": 143, "name": "sbqq_pricing_guidance_c", "comment": null}, "celigo_sfnsio_item_pricing_type_c": {"type": "integer", "index": 144, "name": "celigo_sfnsio_item_pricing_type_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 145, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_celigo_last_modified_date_c": {"type": "timestamp without time zone", "index": 146, "name": "celigo_sfnsio_celigo_last_modified_date_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 147, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 148, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_item_type_c": {"type": "integer", "index": 149, "name": "celigo_sfnsio_net_suite_item_type_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 150, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "promo_code_c": {"type": "integer", "index": 151, "name": "promo_code_c", "comment": null}, "product_category_c": {"type": "integer", "index": 152, "name": "product_category_c", "comment": null}, "product_source_c": {"type": "integer", "index": 153, "name": "product_source_c", "comment": null}, "non_recurring_c": {"type": "boolean", "index": 154, "name": "non_recurring_c", "comment": null}, "is_archived": {"type": "boolean", "index": 155, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 156, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_product_2_data"}, "seed.salesforce_integration_tests.sf_task_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"referral_account_c": {"type": "integer", "index": 1, "name": "referral_account_c", "comment": null}, "who_id": {"type": "text", "index": 2, "name": "who_id", "comment": null}, "call_disposition": {"type": "integer", "index": 3, "name": "call_disposition", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 4, "name": "recurrence_day_of_month", "comment": null}, "owner_id": {"type": "text", "index": 5, "name": "owner_id", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 6, "name": "recurrence_end_date_only", "comment": null}, "subject": {"type": "text", "index": 7, "name": "subject", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 9, "name": "last_modified_date", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 10, "name": "recurrence_time_zone_sid_key", "comment": null}, "is_recurrence": {"type": "boolean", "index": 11, "name": "is_recurrence", "comment": null}, "what_count": {"type": "integer", "index": 12, "name": "what_count", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "call_object": {"type": "integer", "index": 14, "name": "call_object", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 16, "name": "recurrence_day_of_week_mask", "comment": null}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 18, "name": "system_modstamp", "comment": null}, "recurrence_regenerated_type": {"type": "integer", "index": 19, "name": "recurrence_regenerated_type", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "recurrence_type": {"type": "integer", "index": 21, "name": "recurrence_type", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 22, "name": "reminder_date_time", "comment": null}, "call_type": {"type": "integer", "index": 23, "name": "call_type", "comment": null}, "is_high_priority": {"type": "boolean", "index": 24, "name": "is_high_priority", "comment": null}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 26, "name": "recurrence_month_of_year", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 27, "name": "is_reminder_set", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 28, "name": "activity_date", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "priority": {"type": "text", "index": 30, "name": "priority", "comment": null}, "recurrence_interval": {"type": "integer", "index": 31, "name": "recurrence_interval", "comment": null}, "who_count": {"type": "integer", "index": 32, "name": "who_count", "comment": null}, "recurrence_start_date_only": {"type": "timestamp without time zone", "index": 33, "name": "recurrence_start_date_only", "comment": null}, "account_id": {"type": "text", "index": 34, "name": "account_id", "comment": null}, "referral_contact_c": {"type": "integer", "index": 35, "name": "referral_contact_c", "comment": null}, "call_duration_in_seconds": {"type": "integer", "index": 36, "name": "call_duration_in_seconds", "comment": null}, "created_by_id": {"type": "text", "index": 37, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 38, "name": "created_date", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 39, "name": "recurrence_activity_id", "comment": null}, "what_id": {"type": "text", "index": 40, "name": "what_id", "comment": null}, "task_subtype": {"type": "text", "index": 41, "name": "task_subtype", "comment": null}, "status": {"type": "text", "index": 42, "name": "status", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 43, "name": "invitee_uuid_c", "comment": null}, "type": {"type": "text", "index": 44, "name": "type", "comment": null}, "no_show_c": {"type": "boolean", "index": 45, "name": "no_show_c", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 46, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 47, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 48, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 49, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 50, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 52, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 53, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 54, "name": "lid_date_sent_c", "comment": null}, "record_type_id": {"type": "text", "index": 55, "name": "record_type_id", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "completed_date_time": {"type": "timestamp without time zone", "index": 78, "name": "completed_date_time", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 79, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 80, "name": "partner_contact_c", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 81, "name": "co_selling_activity_c", "comment": null}, "description_c": {"type": "integer", "index": 82, "name": "description_c", "comment": null}, "co_sell_partner_account_c": {"type": "integer", "index": 83, "name": "co_sell_partner_account_c", "comment": null}, "campaign_c": {"type": "integer", "index": 84, "name": "campaign_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 85, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 86, "name": "topic_c", "comment": null}, "event_name_c": {"type": "integer", "index": 87, "name": "event_name_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 88, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 89, "name": "partner_activity_type_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 90, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 91, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 92, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 93, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 94, "name": "vidyard_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 95, "name": "expected_payment_date_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 96, "name": "execute_collections_plan_activity_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 97, "name": "collections_hold_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 98, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "text", "index": 99, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "text", "index": 100, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 101, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 102, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "text", "index": 103, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "text", "index": 104, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 105, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 106, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 107, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_task_data"}, "seed.salesforce_integration_tests.sf_user_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "about_me": {"type": "integer", "index": 3, "name": "about_me", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "alias": {"type": "text", "index": 5, "name": "alias", "comment": null}, "badge_text": {"type": "text", "index": 6, "name": "badge_text", "comment": null}, "banner_photo_url": {"type": "text", "index": 7, "name": "banner_photo_url", "comment": null}, "call_center_id": {"type": "integer", "index": 8, "name": "call_center_id", "comment": null}, "city": {"type": "integer", "index": 9, "name": "city", "comment": null}, "community_nickname": {"type": "text", "index": 10, "name": "community_nickname", "comment": null}, "company_name": {"type": "integer", "index": 11, "name": "company_name", "comment": null}, "contact_id": {"type": "integer", "index": 12, "name": "contact_id", "comment": null}, "country": {"type": "text", "index": 13, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 14, "name": "country_code", "comment": null}, "default_group_notification_frequency": {"type": "text", "index": 15, "name": "default_group_notification_frequency", "comment": null}, "delegated_approver_id": {"type": "text", "index": 16, "name": "delegated_approver_id", "comment": null}, "department": {"type": "integer", "index": 17, "name": "department", "comment": null}, "digest_frequency": {"type": "text", "index": 18, "name": "digest_frequency", "comment": null}, "division": {"type": "integer", "index": 19, "name": "division", "comment": null}, "email": {"type": "text", "index": 20, "name": "email", "comment": null}, "email_encoding_key": {"type": "text", "index": 21, "name": "email_encoding_key", "comment": null}, "email_preferences_auto_bcc": {"type": "boolean", "index": 22, "name": "email_preferences_auto_bcc", "comment": null}, "employee_number": {"type": "integer", "index": 23, "name": "employee_number", "comment": null}, "extension": {"type": "integer", "index": 24, "name": "extension", "comment": null}, "fax": {"type": "integer", "index": 25, "name": "fax", "comment": null}, "federation_identifier": {"type": "integer", "index": 26, "name": "federation_identifier", "comment": null}, "first_name": {"type": "text", "index": 27, "name": "first_name", "comment": null}, "forecast_enabled": {"type": "boolean", "index": 28, "name": "forecast_enabled", "comment": null}, "full_photo_url": {"type": "text", "index": 29, "name": "full_photo_url", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 30, "name": "geocode_accuracy", "comment": null}, "id": {"type": "text", "index": 31, "name": "id", "comment": null}, "individual_id": {"type": "integer", "index": 32, "name": "individual_id", "comment": null}, "is_active": {"type": "boolean", "index": 33, "name": "is_active", "comment": null}, "is_profile_photo_active": {"type": "boolean", "index": 34, "name": "is_profile_photo_active", "comment": null}, "language_locale_key": {"type": "text", "index": 35, "name": "language_locale_key", "comment": null}, "last_login_date": {"type": "timestamp without time zone", "index": 36, "name": "last_login_date", "comment": null}, "last_name": {"type": "text", "index": 37, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 38, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 39, "name": "last_viewed_date", "comment": null}, "latitude": {"type": "double precision", "index": 40, "name": "latitude", "comment": null}, "locale_sid_key": {"type": "text", "index": 41, "name": "locale_sid_key", "comment": null}, "longitude": {"type": "double precision", "index": 42, "name": "longitude", "comment": null}, "manager_id": {"type": "text", "index": 43, "name": "manager_id", "comment": null}, "medium_banner_photo_url": {"type": "text", "index": 44, "name": "medium_banner_photo_url", "comment": null}, "mobile_phone": {"type": "integer", "index": 45, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 46, "name": "name", "comment": null}, "offline_trial_expiration_date": {"type": "timestamp without time zone", "index": 47, "name": "offline_trial_expiration_date", "comment": null}, "phone": {"type": "text", "index": 48, "name": "phone", "comment": null}, "postal_code": {"type": "integer", "index": 49, "name": "postal_code", "comment": null}, "profile_id": {"type": "text", "index": 50, "name": "profile_id", "comment": null}, "receives_admin_info_emails": {"type": "boolean", "index": 51, "name": "receives_admin_info_emails", "comment": null}, "receives_info_emails": {"type": "boolean", "index": 52, "name": "receives_info_emails", "comment": null}, "sender_email": {"type": "integer", "index": 53, "name": "sender_email", "comment": null}, "sender_name": {"type": "integer", "index": 54, "name": "sender_name", "comment": null}, "signature": {"type": "integer", "index": 55, "name": "signature", "comment": null}, "small_banner_photo_url": {"type": "text", "index": 56, "name": "small_banner_photo_url", "comment": null}, "small_photo_url": {"type": "text", "index": 57, "name": "small_photo_url", "comment": null}, "state": {"type": "integer", "index": 58, "name": "state", "comment": null}, "state_code": {"type": "integer", "index": 59, "name": "state_code", "comment": null}, "street": {"type": "integer", "index": 60, "name": "street", "comment": null}, "time_zone_sid_key": {"type": "text", "index": 61, "name": "time_zone_sid_key", "comment": null}, "title": {"type": "text", "index": 62, "name": "title", "comment": null}, "user_role_id": {"type": "text", "index": 63, "name": "user_role_id", "comment": null}, "user_type": {"type": "text", "index": 64, "name": "user_type", "comment": null}, "username": {"type": "text", "index": 65, "name": "username", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 66, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_user_data"}, "seed.salesforce_integration_tests.sf_user_role_data": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "case_access_for_account_owner": {"type": "text", "index": 3, "name": "case_access_for_account_owner", "comment": null}, "contact_access_for_account_owner": {"type": "text", "index": 4, "name": "contact_access_for_account_owner", "comment": null}, "developer_name": {"type": "text", "index": 5, "name": "developer_name", "comment": null}, "forecast_user_id": {"type": "integer", "index": 6, "name": "forecast_user_id", "comment": null}, "id": {"type": "text", "index": 7, "name": "id", "comment": null}, "may_forecast_manager_share": {"type": "boolean", "index": 8, "name": "may_forecast_manager_share", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "opportunity_access_for_account_owner": {"type": "text", "index": 10, "name": "opportunity_access_for_account_owner", "comment": null}, "parent_role_id": {"type": "text", "index": 11, "name": "parent_role_id", "comment": null}, "portal_type": {"type": "text", "index": 12, "name": "portal_type", "comment": null}, "rollup_description": {"type": "text", "index": 13, "name": "rollup_description", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 14, "name": "_fivetran_active", "comment": null}}, "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.salesforce_integration_tests.sf_user_role_data"}, "model.salesforce.int_salesforce__date_spine": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "int_salesforce__date_spine", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "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.salesforce.int_salesforce__date_spine"}, "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "int_salesforce__opportunity_aggregation_by_owner", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"owner_id": {"type": "text", "index": 1, "name": "owner_id", "comment": null}, "manager_id": {"type": "text", "index": 2, "name": "manager_id", "comment": null}, "b_manager_id": {"type": "text", "index": 3, "name": "b_manager_id", "comment": null}, "b_owner_id": {"type": "text", "index": 4, "name": "b_owner_id", "comment": null}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 5, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 6, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "bigint", "index": 7, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 8, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "bigint", "index": 9, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 10, "name": "bookings_count_closed_this_quarter", "comment": null}, "avg_bookings_amount": {"type": "numeric", "index": 11, "name": "avg_bookings_amount", "comment": null}, "largest_booking": {"type": "numeric", "index": 12, "name": "largest_booking", "comment": null}, "avg_days_to_close": {"type": "numeric", "index": 13, "name": "avg_days_to_close", "comment": null}, "l_manager_id": {"type": "text", "index": 14, "name": "l_manager_id", "comment": null}, "l_owner_id": {"type": "text", "index": 15, "name": "l_owner_id", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 16, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 17, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "bigint", "index": 18, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 19, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "bigint", "index": 20, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "bigint", "index": 21, "name": "lost_count_this_quarter", "comment": null}, "p_manager_id": {"type": "text", "index": 22, "name": "p_manager_id", "comment": null}, "p_owner_id": {"type": "text", "index": 23, "name": "p_owner_id", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 24, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 26, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 27, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "bigint", "index": 28, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 29, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "bigint", "index": 30, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 31, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 32, "name": "total_pipeline_forecast_amount", "comment": null}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 33, "name": "avg_pipeline_opp_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 34, "name": "largest_deal_in_pipeline", "comment": null}, "avg_days_open": {"type": "numeric", "index": 35, "name": "avg_days_open", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.int_salesforce__opportunity_aggregation_by_owner"}, "model.salesforce.salesforce__account_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__account_daily_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_day_id": {"type": "text", "index": 1, "name": "account_day_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 10, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 11, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 12, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 13, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 14, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 15, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 16, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 17, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 18, "name": "description", "comment": null}, "industry": {"type": "text", "index": 19, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 20, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 30, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 32, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 33, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 34, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 35, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 36, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 37, "name": "type", "comment": null}, "website": {"type": "text", "index": 38, "name": "website", "comment": null}, "row_num": {"type": "bigint", "index": 39, "name": "row_num", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__account_daily_history"}, "model.salesforce.salesforce__contact_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__contact_daily_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"contact_day_id": {"type": "text", "index": 1, "name": "contact_day_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "contact_id": {"type": "text", "index": 3, "name": "contact_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 10, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 11, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 12, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 13, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 14, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 15, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 16, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 17, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 20, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 21, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 22, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 23, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 24, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 25, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 26, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 27, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 29, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 31, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 32, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 33, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 34, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 35, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 36, "name": "home_phone", "comment": null}, "row_num": {"type": "bigint", "index": 37, "name": "row_num", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__contact_daily_history"}, "model.salesforce.salesforce__contact_enhanced": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__contact_enhanced", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"contact_id": {"type": "text", "index": 1, "name": "contact_id", "comment": null}, "contact_name": {"type": "text", "index": 2, "name": "contact_name", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "department": {"type": "text", "index": 4, "name": "department", "comment": null}, "contact_description": {"type": "text", "index": 5, "name": "contact_description", "comment": null}, "email": {"type": "text", "index": 6, "name": "email", "comment": null}, "individual_id": {"type": "text", "index": 7, "name": "individual_id", "comment": null}, "contact_is_deleted": {"type": "boolean", "index": 8, "name": "contact_is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 9, "name": "last_activity_date", "comment": null}, "lead_source": {"type": "text", "index": 10, "name": "lead_source", "comment": null}, "mailing_city": {"type": "text", "index": 11, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 12, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 13, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "text", "index": 14, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 15, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 16, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 17, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "text", "index": 18, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "text", "index": 19, "name": "mobile_phone", "comment": null}, "contact_owner_id": {"type": "text", "index": 20, "name": "contact_owner_id", "comment": null}, "phone": {"type": "text", "index": 21, "name": "phone", "comment": null}, "reports_to_id": {"type": "text", "index": 22, "name": "reports_to_id", "comment": null}, "contact_owner_name": {"type": "text", "index": 23, "name": "contact_owner_name", "comment": null}, "account_name": {"type": "text", "index": 24, "name": "account_name", "comment": null}, "account_number": {"type": "text", "index": 25, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 26, "name": "account_source", "comment": null}, "account_annual_revenue": {"type": "numeric(28,6)", "index": 27, "name": "account_annual_revenue", "comment": null}, "account_description": {"type": "text", "index": 28, "name": "account_description", "comment": null}, "account_industry": {"type": "text", "index": 29, "name": "account_industry", "comment": null}, "account_is_deleted": {"type": "boolean", "index": 30, "name": "account_is_deleted", "comment": null}, "account_number_of_employees": {"type": "integer", "index": 31, "name": "account_number_of_employees", "comment": null}, "account_owner_id": {"type": "text", "index": 32, "name": "account_owner_id", "comment": null}, "account_parent_id": {"type": "text", "index": 33, "name": "account_parent_id", "comment": null}, "account_rating": {"type": "text", "index": 34, "name": "account_rating", "comment": null}, "account_type": {"type": "text", "index": 35, "name": "account_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__contact_enhanced"}, "model.salesforce.salesforce__daily_activity": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__daily_activity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": null}, "leads_created": {"type": "bigint", "index": 2, "name": "leads_created", "comment": null}, "leads_converted": {"type": "bigint", "index": 3, "name": "leads_converted", "comment": null}, "tasks_completed": {"type": "bigint", "index": 4, "name": "tasks_completed", "comment": null}, "events_completed": {"type": "bigint", "index": 5, "name": "events_completed", "comment": null}, "opportunities_created": {"type": "bigint", "index": 6, "name": "opportunities_created", "comment": null}, "opportunities_created_amount": {"type": "numeric", "index": 7, "name": "opportunities_created_amount", "comment": null}, "opportunities_won": {"type": "bigint", "index": 8, "name": "opportunities_won", "comment": null}, "opportunities_won_amount": {"type": "numeric", "index": 9, "name": "opportunities_won_amount", "comment": null}, "opportunities_lost": {"type": "bigint", "index": 10, "name": "opportunities_lost", "comment": null}, "opportunities_lost_amount": {"type": "numeric", "index": 11, "name": "opportunities_lost_amount", "comment": null}, "pipeline_amount": {"type": "numeric", "index": 12, "name": "pipeline_amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__daily_activity"}, "model.salesforce.salesforce__manager_performance": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__manager_performance", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"manager_id": {"type": "text", "index": 1, "name": "manager_id", "comment": null}, "manager_name": {"type": "text", "index": 2, "name": "manager_name", "comment": null}, "manager_city": {"type": "text", "index": 3, "name": "manager_city", "comment": null}, "manager_state": {"type": "text", "index": 4, "name": "manager_state", "comment": null}, "manager_position": {"type": "text", "index": 5, "name": "manager_position", "comment": null}, "number_of_direct_reports": {"type": "bigint", "index": 6, "name": "number_of_direct_reports", "comment": null}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 7, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 8, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "numeric", "index": 9, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 10, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "numeric", "index": 11, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "numeric", "index": 12, "name": "bookings_count_closed_this_quarter", "comment": null}, "largest_booking": {"type": "numeric", "index": 13, "name": "largest_booking", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 14, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 15, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "numeric", "index": 16, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 17, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "numeric", "index": 18, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "numeric", "index": 19, "name": "lost_count_this_quarter", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 20, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 21, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 22, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 23, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "numeric", "index": 24, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "numeric", "index": 26, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 27, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 28, "name": "total_pipeline_forecast_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 29, "name": "largest_deal_in_pipeline", "comment": null}, "win_percent_this_month": {"type": "numeric", "index": 30, "name": "win_percent_this_month", "comment": null}, "win_percent_this_quarter": {"type": "numeric", "index": 31, "name": "win_percent_this_quarter", "comment": null}, "total_win_percent": {"type": "numeric", "index": 32, "name": "total_win_percent", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__manager_performance"}, "model.salesforce.salesforce__opportunity_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__opportunity_daily_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"opportunity_day_id": {"type": "text", "index": 1, "name": "opportunity_day_id", "comment": null}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": null}, "opportunity_id": {"type": "text", "index": 3, "name": "opportunity_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 10, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 11, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 12, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 13, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 14, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 15, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 16, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 17, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 18, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 19, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 20, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 21, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 22, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 23, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 24, "name": "has_overdue_task", "comment": null}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 26, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 27, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 28, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 29, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 30, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 32, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 33, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 34, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 35, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 36, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 37, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 38, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 39, "name": "type", "comment": null}, "row_num": {"type": "bigint", "index": 40, "name": "row_num", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__opportunity_daily_history"}, "model.salesforce.salesforce__opportunity_enhanced": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__opportunity_enhanced", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "numeric(28,6)", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "opportunity_description": {"type": "text", "index": 7, "name": "opportunity_description", "comment": null}, "expected_revenue": {"type": "numeric(28,6)", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 20, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 24, "name": "lead_source", "comment": null}, "opportunity_name": {"type": "text", "index": 25, "name": "opportunity_name", "comment": null}, "next_step": {"type": "text", "index": 26, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "probability": {"type": "double precision", "index": 28, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 30, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "text", "index": 31, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 32, "name": "type", "comment": null}, "is_created_this_month": {"type": "boolean", "index": 33, "name": "is_created_this_month", "comment": null}, "is_created_this_quarter": {"type": "boolean", "index": 34, "name": "is_created_this_quarter", "comment": null}, "days_since_created": {"type": "integer", "index": 35, "name": "days_since_created", "comment": null}, "days_to_close": {"type": "integer", "index": 36, "name": "days_to_close", "comment": null}, "is_closed_this_month": {"type": "boolean", "index": 37, "name": "is_closed_this_month", "comment": null}, "is_closed_this_quarter": {"type": "boolean", "index": 38, "name": "is_closed_this_quarter", "comment": null}, "account_number": {"type": "text", "index": 39, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 40, "name": "account_source", "comment": null}, "industry": {"type": "text", "index": 41, "name": "industry", "comment": null}, "account_name": {"type": "text", "index": 42, "name": "account_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 43, "name": "number_of_employees", "comment": null}, "account_type": {"type": "text", "index": 44, "name": "account_type", "comment": null}, "opportunity_owner_id": {"type": "text", "index": 45, "name": "opportunity_owner_id", "comment": null}, "opportunity_owner_name": {"type": "text", "index": 46, "name": "opportunity_owner_name", "comment": null}, "opportunity_owner_role_id": {"type": "text", "index": 47, "name": "opportunity_owner_role_id", "comment": null}, "opportunity_owner_city": {"type": "text", "index": 48, "name": "opportunity_owner_city", "comment": null}, "opportunity_owner_state": {"type": "text", "index": 49, "name": "opportunity_owner_state", "comment": null}, "opportunity_manager_id": {"type": "text", "index": 50, "name": "opportunity_manager_id", "comment": null}, "opportunity_manager_name": {"type": "text", "index": 51, "name": "opportunity_manager_name", "comment": null}, "opportunity_manager_city": {"type": "text", "index": 52, "name": "opportunity_manager_city", "comment": null}, "opportunity_manager_state": {"type": "text", "index": 53, "name": "opportunity_manager_state", "comment": null}, "opportunity_owner_position": {"type": "text", "index": 54, "name": "opportunity_owner_position", "comment": null}, "opportunity_owner_developer_name": {"type": "text", "index": 55, "name": "opportunity_owner_developer_name", "comment": null}, "opportunity_owner_parent_role_id": {"type": "text", "index": 56, "name": "opportunity_owner_parent_role_id", "comment": null}, "opportunity_owner_rollup_description": {"type": "text", "index": 57, "name": "opportunity_owner_rollup_description", "comment": null}, "status": {"type": "text", "index": 58, "name": "status", "comment": null}, "created_amount_this_month": {"type": "numeric", "index": 59, "name": "created_amount_this_month", "comment": null}, "created_amount_this_quarter": {"type": "numeric", "index": 60, "name": "created_amount_this_quarter", "comment": null}, "created_count_this_month": {"type": "integer", "index": 61, "name": "created_count_this_month", "comment": null}, "created_count_this_quarter": {"type": "integer", "index": 62, "name": "created_count_this_quarter", "comment": null}, "closed_amount_this_month": {"type": "numeric", "index": 63, "name": "closed_amount_this_month", "comment": null}, "closed_amount_this_quarter": {"type": "numeric", "index": 64, "name": "closed_amount_this_quarter", "comment": null}, "closed_count_this_month": {"type": "integer", "index": 65, "name": "closed_count_this_month", "comment": null}, "closed_count_this_quarter": {"type": "integer", "index": 66, "name": "closed_count_this_quarter", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__opportunity_enhanced"}, "model.salesforce.salesforce__opportunity_line_item_enhanced": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__opportunity_line_item_enhanced", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"opportunity_line_item_id": {"type": "text", "index": 1, "name": "opportunity_line_item_id", "comment": null}, "opportunity_line_item_name": {"type": "text", "index": 2, "name": "opportunity_line_item_name", "comment": null}, "opportunity_line_item_description": {"type": "text", "index": 3, "name": "opportunity_line_item_description", "comment": null}, "opportunity_id": {"type": "text", "index": 4, "name": "opportunity_id", "comment": null}, "line_item_index": {"type": "bigint", "index": 5, "name": "line_item_index", "comment": null}, "total_line_items": {"type": "bigint", "index": 6, "name": "total_line_items", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 9, "name": "service_date", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 10, "name": "pricebook_entry_id", "comment": null}, "product_2_id": {"type": "text", "index": 11, "name": "product_2_id", "comment": null}, "list_price": {"type": "numeric(28,6)", "index": 12, "name": "list_price", "comment": null}, "quantity": {"type": "double precision", "index": 13, "name": "quantity", "comment": null}, "unit_price": {"type": "numeric(28,6)", "index": 14, "name": "unit_price", "comment": null}, "total_price": {"type": "numeric(28,6)", "index": 15, "name": "total_price", "comment": null}, "has_quantity_schedule": {"type": "boolean", "index": 16, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "boolean", "index": 17, "name": "has_revenue_schedule", "comment": null}, "product_2_name": {"type": "text", "index": 18, "name": "product_2_name", "comment": null}, "product_code": {"type": "text", "index": 19, "name": "product_code", "comment": null}, "product_2_description": {"type": "text", "index": 20, "name": "product_2_description", "comment": null}, "product_external_id": {"type": "text", "index": 21, "name": "product_external_id", "comment": null}, "product_family": {"type": "text", "index": 22, "name": "product_family", "comment": null}, "product_is_active": {"type": "boolean", "index": 23, "name": "product_is_active", "comment": null}, "product_is_archived": {"type": "boolean", "index": 24, "name": "product_is_archived", "comment": null}, "product_is_deleted": {"type": "boolean", "index": 25, "name": "product_is_deleted", "comment": null}, "product_number_of_quantity_installments": {"type": "integer", "index": 26, "name": "product_number_of_quantity_installments", "comment": null}, "product_quantity_installment_period": {"type": "text", "index": 27, "name": "product_quantity_installment_period", "comment": null}, "product_quantity_schedule_type": {"type": "text", "index": 28, "name": "product_quantity_schedule_type", "comment": null}, "product_quantity_unit_of_measure": {"type": "text", "index": 29, "name": "product_quantity_unit_of_measure", "comment": null}, "product_number_of_revenue_installments": {"type": "integer", "index": 30, "name": "product_number_of_revenue_installments", "comment": null}, "product_revenue_installment_period": {"type": "text", "index": 31, "name": "product_revenue_installment_period", "comment": null}, "product_revenue_schedule_type": {"type": "text", "index": 32, "name": "product_revenue_schedule_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__opportunity_line_item_enhanced"}, "model.salesforce.salesforce__owner_performance": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__owner_performance", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"owner_id": {"type": "text", "index": 1, "name": "owner_id", "comment": null}, "manager_id": {"type": "text", "index": 2, "name": "manager_id", "comment": null}, "b_manager_id": {"type": "text", "index": 3, "name": "b_manager_id", "comment": null}, "b_owner_id": {"type": "text", "index": 4, "name": "b_owner_id", "comment": null}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 5, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 6, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "bigint", "index": 7, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 8, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "bigint", "index": 9, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 10, "name": "bookings_count_closed_this_quarter", "comment": null}, "avg_bookings_amount": {"type": "numeric", "index": 11, "name": "avg_bookings_amount", "comment": null}, "largest_booking": {"type": "numeric", "index": 12, "name": "largest_booking", "comment": null}, "avg_days_to_close": {"type": "numeric", "index": 13, "name": "avg_days_to_close", "comment": null}, "l_manager_id": {"type": "text", "index": 14, "name": "l_manager_id", "comment": null}, "l_owner_id": {"type": "text", "index": 15, "name": "l_owner_id", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 16, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 17, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "bigint", "index": 18, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 19, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "bigint", "index": 20, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "bigint", "index": 21, "name": "lost_count_this_quarter", "comment": null}, "p_manager_id": {"type": "text", "index": 22, "name": "p_manager_id", "comment": null}, "p_owner_id": {"type": "text", "index": 23, "name": "p_owner_id", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 24, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 26, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 27, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "bigint", "index": 28, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 29, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "bigint", "index": 30, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 31, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 32, "name": "total_pipeline_forecast_amount", "comment": null}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 33, "name": "avg_pipeline_opp_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 34, "name": "largest_deal_in_pipeline", "comment": null}, "avg_days_open": {"type": "numeric", "index": 35, "name": "avg_days_open", "comment": null}, "owner_name": {"type": "text", "index": 36, "name": "owner_name", "comment": null}, "owner_city": {"type": "text", "index": 37, "name": "owner_city", "comment": null}, "owner_state": {"type": "text", "index": 38, "name": "owner_state", "comment": null}, "win_percent_this_month": {"type": "numeric", "index": 39, "name": "win_percent_this_month", "comment": null}, "win_percent_this_quarter": {"type": "numeric", "index": 40, "name": "win_percent_this_quarter", "comment": null}, "total_win_percent": {"type": "numeric", "index": 41, "name": "total_win_percent", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__owner_performance"}, "model.salesforce.salesforce__sales_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__sales_snapshot", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"bookings_amount_closed_this_month": {"type": "numeric", "index": 1, "name": "bookings_amount_closed_this_month", "comment": null}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 2, "name": "bookings_amount_closed_this_quarter", "comment": null}, "total_number_bookings": {"type": "bigint", "index": 3, "name": "total_number_bookings", "comment": null}, "total_bookings_amount": {"type": "numeric", "index": 4, "name": "total_bookings_amount", "comment": null}, "bookings_count_closed_this_month": {"type": "bigint", "index": 5, "name": "bookings_count_closed_this_month", "comment": null}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 6, "name": "bookings_count_closed_this_quarter", "comment": null}, "avg_bookings_amount": {"type": "numeric", "index": 7, "name": "avg_bookings_amount", "comment": null}, "largest_booking": {"type": "numeric", "index": 8, "name": "largest_booking", "comment": null}, "avg_days_to_close": {"type": "numeric", "index": 9, "name": "avg_days_to_close", "comment": null}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 10, "name": "pipeline_created_amount_this_month", "comment": null}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 11, "name": "pipeline_created_amount_this_quarter", "comment": null}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 12, "name": "pipeline_created_forecast_amount_this_month", "comment": null}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 13, "name": "pipeline_created_forecast_amount_this_quarter", "comment": null}, "pipeline_count_created_this_month": {"type": "bigint", "index": 14, "name": "pipeline_count_created_this_month", "comment": null}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 15, "name": "pipeline_count_created_this_quarter", "comment": null}, "total_number_pipeline": {"type": "bigint", "index": 16, "name": "total_number_pipeline", "comment": null}, "total_pipeline_amount": {"type": "numeric", "index": 17, "name": "total_pipeline_amount", "comment": null}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 18, "name": "total_pipeline_forecast_amount", "comment": null}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 19, "name": "avg_pipeline_opp_amount", "comment": null}, "largest_deal_in_pipeline": {"type": "numeric", "index": 20, "name": "largest_deal_in_pipeline", "comment": null}, "avg_days_open": {"type": "numeric", "index": 21, "name": "avg_days_open", "comment": null}, "lost_amount_this_month": {"type": "numeric", "index": 22, "name": "lost_amount_this_month", "comment": null}, "lost_amount_this_quarter": {"type": "numeric", "index": 23, "name": "lost_amount_this_quarter", "comment": null}, "total_number_lost": {"type": "bigint", "index": 24, "name": "total_number_lost", "comment": null}, "total_lost_amount": {"type": "numeric", "index": 25, "name": "total_lost_amount", "comment": null}, "lost_count_this_month": {"type": "bigint", "index": 26, "name": "lost_count_this_month", "comment": null}, "lost_count_this_quarter": {"type": "bigint", "index": 27, "name": "lost_count_this_quarter", "comment": null}, "win_percent_this_month": {"type": "numeric", "index": 28, "name": "win_percent_this_month", "comment": null}, "win_percent_this_quarter": {"type": "numeric", "index": 29, "name": "win_percent_this_quarter", "comment": null}, "total_win_percent": {"type": "numeric", "index": 30, "name": "total_win_percent", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce.salesforce__sales_snapshot"}, "model.salesforce_source.stg_salesforce__account": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__account", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "text", "index": 2, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": null}, "annual_revenue": {"type": "numeric(28,6)", "index": 4, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 7, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 8, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 9, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 10, "name": "billing_street", "comment": null}, "account_description": {"type": "text", "index": 11, "name": "account_description", "comment": null}, "account_id": {"type": "text", "index": 12, "name": "account_id", "comment": null}, "industry": {"type": "text", "index": 13, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 15, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 16, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 17, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 18, "name": "master_record_id", "comment": null}, "account_name": {"type": "text", "index": 19, "name": "account_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 20, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 21, "name": "owner_id", "comment": null}, "ownership": {"type": "text", "index": 22, "name": "ownership", "comment": null}, "parent_id": {"type": "text", "index": 23, "name": "parent_id", "comment": null}, "rating": {"type": "text", "index": 24, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 25, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "text", "index": 26, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 27, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 28, "name": "shipping_country_code", "comment": null}, "shipping_postal_code": {"type": "text", "index": 29, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 30, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "text", "index": 31, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 32, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 33, "name": "type", "comment": null}, "website": {"type": "text", "index": 34, "name": "website", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__account"}, "model.salesforce_source.stg_salesforce__account_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__account_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"account_id": {"type": "text", "index": 1, "name": "account_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 8, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 9, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 10, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 11, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 12, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 13, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 14, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 16, "name": "description", "comment": null}, "industry": {"type": "text", "index": 17, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 18, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 19, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 20, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 21, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 22, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 23, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 24, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 26, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 27, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 28, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 30, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 31, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 32, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 33, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 34, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "website": {"type": "text", "index": 36, "name": "website", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__account_history"}, "model.salesforce_source.stg_salesforce__contact": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__contact", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "contact_id": {"type": "text", "index": 2, "name": "contact_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "department": {"type": "text", "index": 4, "name": "department", "comment": null}, "contact_description": {"type": "text", "index": 5, "name": "contact_description", "comment": null}, "email": {"type": "text", "index": 6, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 7, "name": "first_name", "comment": null}, "home_phone": {"type": "text", "index": 8, "name": "home_phone", "comment": null}, "individual_id": {"type": "text", "index": 9, "name": "individual_id", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 11, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 13, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 14, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 15, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 16, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 17, "name": "lead_source", "comment": null}, "mailing_city": {"type": "text", "index": 18, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 19, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 20, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "text", "index": 21, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 22, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 23, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 24, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "text", "index": 25, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "text", "index": 26, "name": "mobile_phone", "comment": null}, "contact_name": {"type": "text", "index": 27, "name": "contact_name", "comment": null}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 29, "name": "phone", "comment": null}, "reports_to_id": {"type": "text", "index": 30, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 31, "name": "title", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__contact"}, "model.salesforce_source.stg_salesforce__contact_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__contact_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"contact_id": {"type": "text", "index": 1, "name": "contact_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 8, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 9, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 10, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 12, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 14, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 15, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 16, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 17, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 18, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 19, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 20, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 21, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 22, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 23, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 24, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 25, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 28, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 29, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 30, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 32, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 33, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 34, "name": "home_phone", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__contact_history"}, "model.salesforce_source.stg_salesforce__event": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__event", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "event_description": {"type": "text", "index": 8, "name": "event_description", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 9, "name": "end_date", "comment": null}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": null}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": null}, "group_event_type": {"type": "text", "index": 12, "name": "group_event_type", "comment": null}, "is_archived": {"type": "boolean", "index": 13, "name": "is_archived", "comment": null}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": null}, "is_recurrence": {"type": "boolean", "index": 17, "name": "is_recurrence", "comment": null}, "last_modified_by_id": {"type": "text", "index": 18, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 19, "name": "last_modified_date", "comment": null}, "location": {"type": "text", "index": 20, "name": "location", "comment": null}, "owner_id": {"type": "text", "index": 21, "name": "owner_id", "comment": null}, "start_date_time": {"type": "timestamp without time zone", "index": 22, "name": "start_date_time", "comment": null}, "subject": {"type": "text", "index": 23, "name": "subject", "comment": null}, "type": {"type": "text", "index": 24, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 25, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 26, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 27, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 28, "name": "who_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.salesforce_source.stg_salesforce__event"}, "model.salesforce_source.stg_salesforce__lead": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__lead", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "lead_id": {"type": "text", "index": 2, "name": "lead_id", "comment": null}, "annual_revenue": {"type": "numeric(28,6)", "index": 3, "name": "annual_revenue", "comment": null}, "city": {"type": "text", "index": 4, "name": "city", "comment": null}, "company": {"type": "text", "index": 5, "name": "company", "comment": null}, "converted_account_id": {"type": "text", "index": 6, "name": "converted_account_id", "comment": null}, "converted_contact_id": {"type": "text", "index": 7, "name": "converted_contact_id", "comment": null}, "converted_date": {"type": "timestamp without time zone", "index": 8, "name": "converted_date", "comment": null}, "converted_opportunity_id": {"type": "text", "index": 9, "name": "converted_opportunity_id", "comment": null}, "country": {"type": "text", "index": 10, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 11, "name": "country_code", "comment": null}, "created_by_id": {"type": "text", "index": 12, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 13, "name": "created_date", "comment": null}, "lead_description": {"type": "text", "index": 14, "name": "lead_description", "comment": null}, "email": {"type": "text", "index": 15, "name": "email", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 16, "name": "email_bounced_date", "comment": null}, "email_bounced_reason": {"type": "text", "index": 17, "name": "email_bounced_reason", "comment": null}, "first_name": {"type": "text", "index": 18, "name": "first_name", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 19, "name": "has_opted_out_of_email", "comment": null}, "individual_id": {"type": "text", "index": 20, "name": "individual_id", "comment": null}, "industry": {"type": "text", "index": 21, "name": "industry", "comment": null}, "is_converted": {"type": "boolean", "index": 22, "name": "is_converted", "comment": null}, "is_deleted": {"type": "boolean", "index": 23, "name": "is_deleted", "comment": null}, "is_unread_by_owner": {"type": "boolean", "index": 24, "name": "is_unread_by_owner", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 25, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 28, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 29, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 30, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": null}, "master_record_id": {"type": "text", "index": 32, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "text", "index": 33, "name": "mobile_phone", "comment": null}, "lead_name": {"type": "text", "index": 34, "name": "lead_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 35, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 36, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 37, "name": "phone", "comment": null}, "postal_code": {"type": "text", "index": 38, "name": "postal_code", "comment": null}, "state": {"type": "text", "index": 39, "name": "state", "comment": null}, "state_code": {"type": "text", "index": 40, "name": "state_code", "comment": null}, "status": {"type": "text", "index": 41, "name": "status", "comment": null}, "street": {"type": "text", "index": 42, "name": "street", "comment": null}, "title": {"type": "text", "index": 43, "name": "title", "comment": null}, "website": {"type": "text", "index": 44, "name": "website", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__lead"}, "model.salesforce_source.stg_salesforce__opportunity": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__opportunity", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "numeric(28,6)", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "opportunity_description": {"type": "text", "index": 7, "name": "opportunity_description", "comment": null}, "expected_revenue": {"type": "numeric(28,6)", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 20, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 24, "name": "lead_source", "comment": null}, "opportunity_name": {"type": "text", "index": 25, "name": "opportunity_name", "comment": null}, "next_step": {"type": "text", "index": 26, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "probability": {"type": "double precision", "index": 28, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 30, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "text", "index": 31, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 32, "name": "type", "comment": null}, "is_created_this_month": {"type": "boolean", "index": 33, "name": "is_created_this_month", "comment": null}, "is_created_this_quarter": {"type": "boolean", "index": 34, "name": "is_created_this_quarter", "comment": null}, "days_since_created": {"type": "integer", "index": 35, "name": "days_since_created", "comment": null}, "days_to_close": {"type": "integer", "index": 36, "name": "days_to_close", "comment": null}, "is_closed_this_month": {"type": "boolean", "index": 37, "name": "is_closed_this_month", "comment": null}, "is_closed_this_quarter": {"type": "boolean", "index": 38, "name": "is_closed_this_quarter", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__opportunity"}, "model.salesforce_source.stg_salesforce__opportunity_history": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__opportunity_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"opportunity_id": {"type": "text", "index": 1, "name": "opportunity_id", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 8, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 9, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 10, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 11, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 12, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 13, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 14, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 15, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 16, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 17, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 18, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 19, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 20, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 21, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 22, "name": "has_overdue_task", "comment": null}, "is_closed": {"type": "boolean", "index": 23, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 25, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 26, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 27, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 28, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 30, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 31, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 33, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 34, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 35, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 36, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 37, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_history"}, "model.salesforce_source.stg_salesforce__opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__opportunity_line_item", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "opportunity_line_item_id": {"type": "text", "index": 2, "name": "opportunity_line_item_id", "comment": null}, "created_by_id": {"type": "text", "index": 3, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 4, "name": "created_date", "comment": null}, "opportunity_line_item_description": {"type": "text", "index": 5, "name": "opportunity_line_item_description", "comment": null}, "discount": {"type": "double precision", "index": 6, "name": "discount", "comment": null}, "has_quantity_schedule": {"type": "boolean", "index": 7, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "boolean", "index": 8, "name": "has_revenue_schedule", "comment": null}, "has_schedule": {"type": "boolean", "index": 9, "name": "has_schedule", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 13, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 14, "name": "last_viewed_date", "comment": null}, "list_price": {"type": "numeric(28,6)", "index": 15, "name": "list_price", "comment": null}, "opportunity_line_item_name": {"type": "text", "index": 16, "name": "opportunity_line_item_name", "comment": null}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 18, "name": "pricebook_entry_id", "comment": null}, "product_2_id": {"type": "text", "index": 19, "name": "product_2_id", "comment": null}, "product_code": {"type": "text", "index": 20, "name": "product_code", "comment": null}, "quantity": {"type": "double precision", "index": 21, "name": "quantity", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 22, "name": "service_date", "comment": null}, "sort_order": {"type": "integer", "index": 23, "name": "sort_order", "comment": null}, "total_price": {"type": "numeric(28,6)", "index": 24, "name": "total_price", "comment": null}, "unit_price": {"type": "numeric(28,6)", "index": 25, "name": "unit_price", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_line_item"}, "model.salesforce_source.stg_salesforce__order": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__order", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "order_id": {"type": "text", "index": 2, "name": "order_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": null}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": null}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "text", "index": 8, "name": "billing_country_code", "comment": null}, "billing_postal_code": {"type": "text", "index": 9, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 10, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 11, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": null}, "contract_id": {"type": "text", "index": 13, "name": "contract_id", "comment": null}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": null}, "order_description": {"type": "text", "index": 16, "name": "order_description", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 17, "name": "end_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 18, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 19, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 20, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 21, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 22, "name": "last_viewed_date", "comment": null}, "opportunity_id": {"type": "text", "index": 23, "name": "opportunity_id", "comment": null}, "order_number": {"type": "text", "index": 24, "name": "order_number", "comment": null}, "original_order_id": {"type": "text", "index": 25, "name": "original_order_id", "comment": null}, "owner_id": {"type": "text", "index": 26, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 27, "name": "pricebook_2_id", "comment": null}, "shipping_city": {"type": "text", "index": 28, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 30, "name": "shipping_country_code", "comment": null}, "shipping_postal_code": {"type": "text", "index": 31, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 32, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "text", "index": 33, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 34, "name": "shipping_street", "comment": null}, "status": {"type": "text", "index": 35, "name": "status", "comment": null}, "total_amount": {"type": "numeric(28,6)", "index": 36, "name": "total_amount", "comment": null}, "type": {"type": "text", "index": 37, "name": "type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__order"}, "model.salesforce_source.stg_salesforce__product_2": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__product_2", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "product_2_id": {"type": "text", "index": 2, "name": "product_2_id", "comment": null}, "created_by_id": {"type": "text", "index": 3, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 4, "name": "created_date", "comment": null}, "product_2_description": {"type": "text", "index": 5, "name": "product_2_description", "comment": null}, "display_url": {"type": "text", "index": 6, "name": "display_url", "comment": null}, "external_id": {"type": "text", "index": 7, "name": "external_id", "comment": null}, "family": {"type": "text", "index": 8, "name": "family", "comment": null}, "is_active": {"type": "boolean", "index": 9, "name": "is_active", "comment": null}, "is_archived": {"type": "boolean", "index": 10, "name": "is_archived", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 13, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 14, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": null}, "product_2_name": {"type": "text", "index": 16, "name": "product_2_name", "comment": null}, "number_of_quantity_installments": {"type": "integer", "index": 17, "name": "number_of_quantity_installments", "comment": null}, "number_of_revenue_installments": {"type": "integer", "index": 18, "name": "number_of_revenue_installments", "comment": null}, "product_code": {"type": "text", "index": 19, "name": "product_code", "comment": null}, "quantity_installment_period": {"type": "text", "index": 20, "name": "quantity_installment_period", "comment": null}, "quantity_schedule_type": {"type": "text", "index": 21, "name": "quantity_schedule_type", "comment": null}, "quantity_unit_of_measure": {"type": "text", "index": 22, "name": "quantity_unit_of_measure", "comment": null}, "record_type_id": {"type": "text", "index": 23, "name": "record_type_id", "comment": null}, "revenue_installment_period": {"type": "text", "index": 24, "name": "revenue_installment_period", "comment": null}, "revenue_schedule_type": {"type": "text", "index": 25, "name": "revenue_schedule_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__product_2"}, "model.salesforce_source.stg_salesforce__task": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__task", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "task_id": {"type": "text", "index": 2, "name": "task_id", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "call_disposition": {"type": "text", "index": 5, "name": "call_disposition", "comment": null}, "call_duration_in_seconds": {"type": "integer", "index": 6, "name": "call_duration_in_seconds", "comment": null}, "call_object": {"type": "text", "index": 7, "name": "call_object", "comment": null}, "call_type": {"type": "text", "index": 8, "name": "call_type", "comment": null}, "completed_date_time": {"type": "timestamp without time zone", "index": 9, "name": "completed_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 10, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 11, "name": "created_date", "comment": null}, "task_description": {"type": "text", "index": 12, "name": "task_description", "comment": null}, "is_archived": {"type": "boolean", "index": 13, "name": "is_archived", "comment": null}, "is_closed": {"type": "boolean", "index": 14, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_high_priority": {"type": "boolean", "index": 16, "name": "is_high_priority", "comment": null}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 18, "name": "last_modified_date", "comment": null}, "owner_id": {"type": "text", "index": 19, "name": "owner_id", "comment": null}, "priority": {"type": "text", "index": 20, "name": "priority", "comment": null}, "record_type_id": {"type": "text", "index": 21, "name": "record_type_id", "comment": null}, "status": {"type": "text", "index": 22, "name": "status", "comment": null}, "subject": {"type": "text", "index": 23, "name": "subject", "comment": null}, "task_subtype": {"type": "text", "index": 24, "name": "task_subtype", "comment": null}, "type": {"type": "text", "index": 25, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 26, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 27, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 28, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 29, "name": "who_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.salesforce_source.stg_salesforce__task"}, "model.salesforce_source.stg_salesforce__user": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__user", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "alias": {"type": "text", "index": 4, "name": "alias", "comment": null}, "city": {"type": "text", "index": 5, "name": "city", "comment": null}, "company_name": {"type": "text", "index": 6, "name": "company_name", "comment": null}, "contact_id": {"type": "text", "index": 7, "name": "contact_id", "comment": null}, "country": {"type": "text", "index": 8, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 9, "name": "country_code", "comment": null}, "department": {"type": "text", "index": 10, "name": "department", "comment": null}, "email": {"type": "text", "index": 11, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 12, "name": "first_name", "comment": null}, "user_id": {"type": "text", "index": 13, "name": "user_id", "comment": null}, "individual_id": {"type": "text", "index": 14, "name": "individual_id", "comment": null}, "is_active": {"type": "boolean", "index": 15, "name": "is_active", "comment": null}, "last_login_date": {"type": "timestamp without time zone", "index": 16, "name": "last_login_date", "comment": null}, "last_name": {"type": "text", "index": 17, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "manager_id": {"type": "text", "index": 20, "name": "manager_id", "comment": null}, "user_name": {"type": "text", "index": 21, "name": "user_name", "comment": null}, "postal_code": {"type": "text", "index": 22, "name": "postal_code", "comment": null}, "profile_id": {"type": "text", "index": 23, "name": "profile_id", "comment": null}, "state": {"type": "text", "index": 24, "name": "state", "comment": null}, "state_code": {"type": "text", "index": 25, "name": "state_code", "comment": null}, "street": {"type": "text", "index": 26, "name": "street", "comment": null}, "title": {"type": "text", "index": 27, "name": "title", "comment": null}, "user_role_id": {"type": "text", "index": 28, "name": "user_role_id", "comment": null}, "user_type": {"type": "text", "index": 29, "name": "user_type", "comment": null}, "username": {"type": "text", "index": 30, "name": "username", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.salesforce_source.stg_salesforce__user"}, "model.salesforce_source.stg_salesforce__user_role": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__user_role", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "developer_name": {"type": "text", "index": 3, "name": "developer_name", "comment": null}, "user_role_id": {"type": "text", "index": 4, "name": "user_role_id", "comment": null}, "user_role_name": {"type": "text", "index": 5, "name": "user_role_name", "comment": null}, "opportunity_access_for_account_owner": {"type": "text", "index": 6, "name": "opportunity_access_for_account_owner", "comment": null}, "parent_role_id": {"type": "text", "index": 7, "name": "parent_role_id", "comment": null}, "rollup_description": {"type": "text", "index": 8, "name": "rollup_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.salesforce_source.stg_salesforce__user_role"}}, "sources": {"source.salesforce_source.salesforce.account": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 2, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 4, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "text", "index": 7, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 8, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "double precision", "index": 9, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "double precision", "index": 10, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 11, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 12, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "text", "index": 13, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 14, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 15, "name": "description", "comment": null}, "fax": {"type": "integer", "index": 16, "name": "fax", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "industry": {"type": "text", "index": 18, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "jigsaw_company_id": {"type": "integer", "index": 20, "name": "jigsaw_company_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": null}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 31, "name": "photo_url", "comment": null}, "rating": {"type": "integer", "index": 32, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 33, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "text", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "double precision", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "double precision", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "integer", "index": 43, "name": "shipping_street", "comment": null}, "sic": {"type": "integer", "index": 44, "name": "sic", "comment": null}, "sic_desc": {"type": "integer", "index": 45, "name": "sic_desc", "comment": null}, "site": {"type": "integer", "index": 46, "name": "site", "comment": null}, "ticker_symbol": {"type": "integer", "index": 47, "name": "ticker_symbol", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "website": {"type": "text", "index": 49, "name": "website", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 50, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.account"}, "source.salesforce_source.salesforce_history.account": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_number": {"type": "integer", "index": 5, "name": "account_number", "comment": null}, "account_source": {"type": "text", "index": 6, "name": "account_source", "comment": null}, "annual_revenue": {"type": "double precision", "index": 7, "name": "annual_revenue", "comment": null}, "billing_city": {"type": "text", "index": 8, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 9, "name": "billing_country", "comment": null}, "billing_postal_code": {"type": "text", "index": 10, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 11, "name": "billing_state", "comment": null}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": null}, "description": {"type": "text", "index": 13, "name": "description", "comment": null}, "id": {"type": "text", "index": 14, "name": "id", "comment": null}, "industry": {"type": "text", "index": 15, "name": "industry", "comment": null}, "is_deleted": {"type": "boolean", "index": 16, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": null}, "master_record_id": {"type": "text", "index": 20, "name": "master_record_id", "comment": null}, "name": {"type": "text", "index": 21, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 22, "name": "number_of_employees", "comment": null}, "owner_id": {"type": "text", "index": 23, "name": "owner_id", "comment": null}, "ownership": {"type": "integer", "index": 24, "name": "ownership", "comment": null}, "parent_id": {"type": "integer", "index": 25, "name": "parent_id", "comment": null}, "rating": {"type": "integer", "index": 26, "name": "rating", "comment": null}, "record_type_id": {"type": "text", "index": 27, "name": "record_type_id", "comment": null}, "shipping_city": {"type": "integer", "index": 28, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 30, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "integer", "index": 31, "name": "shipping_state", "comment": null}, "shipping_street": {"type": "integer", "index": 32, "name": "shipping_street", "comment": null}, "type": {"type": "text", "index": 33, "name": "type", "comment": null}, "website": {"type": "text", "index": 34, "name": "website", "comment": null}}, "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.salesforce_source.salesforce_history.account"}, "source.salesforce_source.salesforce.contact": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "cbit_clearbit_c": {"type": "text", "index": 4, "name": "cbit_clearbit_c", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 5, "name": "cbit_clearbit_ready_c", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "department": {"type": "integer", "index": 8, "name": "department", "comment": null}, "email": {"type": "text", "index": 9, "name": "email", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 10, "name": "email_bounced_date", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 11, "name": "email_bounced_reason", "comment": null}, "fax": {"type": "integer", "index": 12, "name": "fax", "comment": null}, "first_name": {"type": "text", "index": 13, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": null}, "is_email_bounced": {"type": "boolean", "index": 15, "name": "is_email_bounced", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 16, "name": "jigsaw_contact_id", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 17, "name": "last_activity_date", "comment": null}, "last_curequest_date": {"type": "timestamp without time zone", "index": 18, "name": "last_curequest_date", "comment": null}, "last_cuupdate_date": {"type": "timestamp without time zone", "index": 19, "name": "last_cuupdate_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 22, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 25, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 26, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 27, "name": "mailing_country_code", "comment": null}, "mailing_geocode_accuracy": {"type": "integer", "index": 28, "name": "mailing_geocode_accuracy", "comment": null}, "mailing_latitude": {"type": "integer", "index": 29, "name": "mailing_latitude", "comment": null}, "mailing_longitude": {"type": "integer", "index": 30, "name": "mailing_longitude", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 31, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 32, "name": "mailing_state", "comment": null}, "mailing_state_code": {"type": "text", "index": 33, "name": "mailing_state_code", "comment": null}, "mailing_street": {"type": "text", "index": 34, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 35, "name": "master_record_id", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 36, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "mobile_phone": {"type": "integer", "index": 37, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 38, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 39, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 40, "name": "phone", "comment": null}, "photo_url": {"type": "text", "index": 41, "name": "photo_url", "comment": null}, "reports_to_id": {"type": "integer", "index": 42, "name": "reports_to_id", "comment": null}, "salutation": {"type": "integer", "index": 43, "name": "salutation", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 44, "name": "system_modstamp", "comment": null}, "title": {"type": "text", "index": 45, "name": "title", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 46, "name": "email_bounced_c", "comment": null}, "email_quality_unknown_c": {"type": "boolean", "index": 47, "name": "email_quality_unknown_c", "comment": null}, "gclid_c": {"type": "integer", "index": 48, "name": "gclid_c", "comment": null}, "referral_account_c": {"type": "integer", "index": 49, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 50, "name": "referral_contact_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 51, "name": "has_opted_out_of_email", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 52, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 53, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 54, "name": "fivetran_user_id_c", "comment": null}, "no_longer_at_company_c": {"type": "boolean", "index": 55, "name": "no_longer_at_company_c", "comment": null}, "pi_campaign_c": {"type": "text", "index": 56, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 57, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 58, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 59, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 60, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "timestamp without time zone", "index": 61, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 62, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 63, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 64, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 65, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 66, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 67, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "boolean", "index": 68, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 69, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "boolean", "index": 70, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 71, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 72, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "text", "index": 73, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 74, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 75, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 76, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 77, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 78, "name": "pi_utm_term_c", "comment": null}, "lead_source": {"type": "text", "index": 79, "name": "lead_source", "comment": null}, "contact_status_c": {"type": "text", "index": 80, "name": "contact_status_c", "comment": null}, "region_c": {"type": "integer", "index": 81, "name": "region_c", "comment": null}, "competitor_c": {"type": "integer", "index": 82, "name": "competitor_c", "comment": null}, "bt_stripe_gender_c": {"type": "integer", "index": 83, "name": "bt_stripe_gender_c", "comment": null}, "bt_stripe_ssn_last_4_encrypted_c": {"type": "integer", "index": 84, "name": "bt_stripe_ssn_last_4_encrypted_c", "comment": null}, "bt_stripe_personal_id_number_c": {"type": "integer", "index": 85, "name": "bt_stripe_personal_id_number_c", "comment": null}, "bt_stripe_personal_id_number_encrypted_c": {"type": "integer", "index": 86, "name": "bt_stripe_personal_id_number_encrypted_c", "comment": null}, "bt_stripe_maiden_name_c": {"type": "integer", "index": 87, "name": "bt_stripe_maiden_name_c", "comment": null}, "bt_stripe_languages_c": {"type": "integer", "index": 88, "name": "bt_stripe_languages_c", "comment": null}, "bt_stripe_default_payment_method_c": {"type": "integer", "index": 89, "name": "bt_stripe_default_payment_method_c", "comment": null}, "bt_stripe_ssn_last_4_c": {"type": "integer", "index": 90, "name": "bt_stripe_ssn_last_4_c", "comment": null}, "bt_stripe_personal_id_type_c": {"type": "integer", "index": 91, "name": "bt_stripe_personal_id_type_c", "comment": null}, "bt_stripe_default_payment_gateway_c": {"type": "integer", "index": 92, "name": "bt_stripe_default_payment_gateway_c", "comment": null}, "bt_stripe_level_c": {"type": "integer", "index": 93, "name": "bt_stripe_level_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 94, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 95, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 96, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 97, "name": "lean_data_tag_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 98, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 99, "name": "do_not_route_lead_c", "comment": null}, "technical_contact_c": {"type": "integer", "index": 100, "name": "technical_contact_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 101, "name": "allbound_id_c", "comment": null}, "notes_c": {"type": "integer", "index": 102, "name": "notes_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 103, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 104, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 105, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 106, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 107, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_pushed_from_opportunity_c": {"type": "boolean", "index": 108, "name": "netsuite_conn_pushed_from_opportunity_c", "comment": null}, "description": {"type": "text", "index": 109, "name": "description", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 110, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 111, "name": "lid_linked_in_member_token_c", "comment": null}, "is_eu_resident_c": {"type": "boolean", "index": 112, "name": "is_eu_resident_c", "comment": null}, "do_not_call": {"type": "boolean", "index": 113, "name": "do_not_call", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 114, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 115, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 116, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "source_detail_c": {"type": "text", "index": 117, "name": "source_detail_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 118, "name": "utm_source_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 119, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 120, "name": "utm_term_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 121, "name": "utm_medium_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 122, "name": "utm_campaign_c", "comment": null}, "network_c": {"type": "integer", "index": 123, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 124, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 125, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 126, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 127, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 128, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 129, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 130, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 131, "name": "partner_rep_name_c", "comment": null}, "contact_type_c": {"type": "integer", "index": 132, "name": "contact_type_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 133, "name": "old_lead_source_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 134, "name": "old_lead_source_detail_c", "comment": null}, "contact_stage_c": {"type": "integer", "index": 135, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 136, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 137, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 138, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 139, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 140, "name": "original_utm_term_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 141, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 142, "name": "es_app_esecid_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 143, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 144, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 145, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 146, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 147, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 148, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 149, "name": "es_app_essource_c", "comment": null}, "individual_id": {"type": "integer", "index": 150, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 151, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 152, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 153, "name": "user_gems_has_changed_job_c", "comment": null}, "email_opt_in_explicit_c": {"type": "integer", "index": 154, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "integer", "index": 155, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "integer", "index": 156, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "integer", "index": 157, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 158, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 159, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 160, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 161, "name": "user_gems_past_title_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 162, "name": "partner_contact_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 163, "name": "promotion_id_c", "comment": null}, "referral_exists_c": {"type": "integer", "index": 164, "name": "referral_exists_c", "comment": null}, "referral_first_name_c": {"type": "integer", "index": 165, "name": "referral_first_name_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 166, "name": "referral_last_name_c", "comment": null}, "mkto_71_contact_acquisition_date_c": {"type": "integer", "index": 167, "name": "mkto_71_contact_acquisition_date_c", "comment": null}, "mkto_71_contact_acquisition_program_c": {"type": "integer", "index": 168, "name": "mkto_71_contact_acquisition_program_c", "comment": null}, "mkto_71_contact_acquisition_program_id_c": {"type": "integer", "index": 169, "name": "mkto_71_contact_acquisition_program_id_c", "comment": null}, "mkto_71_contact_inferred_city_c": {"type": "integer", "index": 170, "name": "mkto_71_contact_inferred_city_c", "comment": null}, "mkto_71_contact_inferred_company_c": {"type": "integer", "index": 171, "name": "mkto_71_contact_inferred_company_c", "comment": null}, "mkto_71_contact_inferred_country_c": {"type": "integer", "index": 172, "name": "mkto_71_contact_inferred_country_c", "comment": null}, "mkto_71_contact_inferred_metropolitan_a_c": {"type": "integer", "index": 173, "name": "mkto_71_contact_inferred_metropolitan_a_c", "comment": null}, "mkto_71_contact_inferred_phone_area_cod_c": {"type": "integer", "index": 174, "name": "mkto_71_contact_inferred_phone_area_cod_c", "comment": null}, "mkto_71_contact_inferred_postal_code_c": {"type": "integer", "index": 175, "name": "mkto_71_contact_inferred_postal_code_c", "comment": null}, "mkto_71_contact_inferred_state_region_c": {"type": "integer", "index": 176, "name": "mkto_71_contact_inferred_state_region_c", "comment": null}, "mkto_71_contact_lead_score_c": {"type": "integer", "index": 177, "name": "mkto_71_contact_lead_score_c", "comment": null}, "mkto_71_contact_original_referrer_c": {"type": "integer", "index": 178, "name": "mkto_71_contact_original_referrer_c", "comment": null}, "mkto_71_contact_original_search_engine_c": {"type": "integer", "index": 179, "name": "mkto_71_contact_original_search_engine_c", "comment": null}, "mkto_71_contact_original_search_phrase_c": {"type": "integer", "index": 180, "name": "mkto_71_contact_original_search_phrase_c", "comment": null}, "mkto_71_contact_original_source_info_c": {"type": "integer", "index": 181, "name": "mkto_71_contact_original_source_info_c", "comment": null}, "mkto_71_contact_original_source_type_c": {"type": "integer", "index": 182, "name": "mkto_71_contact_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 183, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "integer", "index": 184, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "integer", "index": 185, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "integer", "index": 186, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "integer", "index": 187, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_mkto_lead_score_c": {"type": "integer", "index": 188, "name": "mkto_si_mkto_lead_score_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 189, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 190, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 191, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ces_c": {"type": "integer", "index": 192, "name": "cloudingo_agent_ces_c", "comment": null}, "cloudingo_agent_mar_c": {"type": "integer", "index": 193, "name": "cloudingo_agent_mar_c", "comment": null}, "cloudingo_agent_mas_c": {"type": "integer", "index": 194, "name": "cloudingo_agent_mas_c", "comment": null}, "cloudingo_agent_mav_c": {"type": "integer", "index": 195, "name": "cloudingo_agent_mav_c", "comment": null}, "cloudingo_agent_mrdi_c": {"type": "integer", "index": 196, "name": "cloudingo_agent_mrdi_c", "comment": null}, "cloudingo_agent_mtz_c": {"type": "integer", "index": 197, "name": "cloudingo_agent_mtz_c", "comment": null}, "cloudingo_agent_oar_c": {"type": "integer", "index": 198, "name": "cloudingo_agent_oar_c", "comment": null}, "cloudingo_agent_oas_c": {"type": "integer", "index": 199, "name": "cloudingo_agent_oas_c", "comment": null}, "cloudingo_agent_oav_c": {"type": "integer", "index": 200, "name": "cloudingo_agent_oav_c", "comment": null}, "cloudingo_agent_ordi_c": {"type": "integer", "index": 201, "name": "cloudingo_agent_ordi_c", "comment": null}, "cloudingo_agent_otz_c": {"type": "integer", "index": 202, "name": "cloudingo_agent_otz_c", "comment": null}, "do_not_sync_marketo_c": {"type": "integer", "index": 203, "name": "do_not_sync_marketo_c", "comment": null}, "phone_extension_c": {"type": "integer", "index": 204, "name": "phone_extension_c", "comment": null}, "job_function_c": {"type": "integer", "index": 205, "name": "job_function_c", "comment": null}, "job_level_c": {"type": "integer", "index": 206, "name": "job_level_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 207, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 208, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 209, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 210, "name": "state_c", "comment": null}, "secondary_email_c": {"type": "integer", "index": 211, "name": "secondary_email_c", "comment": null}, "es_seniority_c": {"type": "integer", "index": 212, "name": "es_seniority_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 213, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 214, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 215, "name": "source_last_lead_source_detail_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 216, "name": "drift_cql_c", "comment": null}, "hot_contact_c": {"type": "integer", "index": 217, "name": "hot_contact_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 218, "name": "behavioral_score_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 219, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "integer", "index": 220, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 221, "name": "csi_code_c", "comment": null}, "clearbit_role_c": {"type": "integer", "index": 222, "name": "clearbit_role_c", "comment": null}, "clearbit_seniority_c": {"type": "integer", "index": 223, "name": "clearbit_seniority_c", "comment": null}, "clearbit_sub_role_c": {"type": "integer", "index": 224, "name": "clearbit_sub_role_c", "comment": null}, "rh_2_currency_test_c": {"type": "integer", "index": 225, "name": "rh_2_currency_test_c", "comment": null}, "rh_2_describe_c": {"type": "integer", "index": 226, "name": "rh_2_describe_c", "comment": null}, "rh_2_integer_test_c": {"type": "integer", "index": 227, "name": "rh_2_integer_test_c", "comment": null}, "created_by_role_c": {"type": "integer", "index": 228, "name": "created_by_role_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 229, "name": "demographic_score_c", "comment": null}, "country_code_c": {"type": "integer", "index": 230, "name": "country_code_c", "comment": null}, "state_code_c": {"type": "integer", "index": 231, "name": "state_code_c", "comment": null}, "attended_event_c": {"type": "integer", "index": 232, "name": "attended_event_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 233, "name": "zoominfo_technologies_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 234, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 235, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 236, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 237, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 238, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 239, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "integer", "index": 240, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 241, "name": "first_mql_date_c", "comment": null}, "active_relationship_c": {"type": "integer", "index": 242, "name": "active_relationship_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 243, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 244, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 245, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 246, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 247, "name": "clarus_status_c", "comment": null}, "historical_contact_status_c": {"type": "integer", "index": 248, "name": "historical_contact_status_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 249, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 250, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "integer", "index": 251, "name": "mql_reason_c", "comment": null}, "attempting_contact_date_time_c": {"type": "integer", "index": 252, "name": "attempting_contact_date_time_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 253, "name": "linked_in_url_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 254, "name": "trial_contact_start_date_c", "comment": null}, "contact_holdover_c": {"type": "integer", "index": 255, "name": "contact_holdover_c", "comment": null}, "bill_to_contact_hidden_c": {"type": "integer", "index": 256, "name": "bill_to_contact_hidden_c", "comment": null}, "enrichment_request_c": {"type": "integer", "index": 257, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "integer", "index": 258, "name": "meta_data_create_date_c", "comment": null}, "primary_se_c": {"type": "integer", "index": 259, "name": "primary_se_c", "comment": null}, "unqualified_reason_c": {"type": "integer", "index": 260, "name": "unqualified_reason_c", "comment": null}, "opp_handoff_ae_c": {"type": "integer", "index": 261, "name": "opp_handoff_ae_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 262, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 263, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 264, "name": "salesloft_cadence_trigger_c", "comment": null}, "last_ae_activity_owner_c": {"type": "integer", "index": 265, "name": "last_ae_activity_owner_c", "comment": null}, "last_bdr_activity_owner_c": {"type": "integer", "index": 266, "name": "last_bdr_activity_owner_c", "comment": null}, "last_manual_ae_activity_date_c": {"type": "integer", "index": 267, "name": "last_manual_ae_activity_date_c", "comment": null}, "last_manual_bdr_activity_date_c": {"type": "integer", "index": 268, "name": "last_manual_bdr_activity_date_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 269, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "integer", "index": 270, "name": "potential_fivetran_use_case_c", "comment": null}, "lean_data_router_completion_date_time_c": {"type": "integer", "index": 271, "name": "lean_data_router_completion_date_time_c", "comment": null}, "partner_territory_c": {"type": "integer", "index": 272, "name": "partner_territory_c", "comment": null}, "partner_company_c": {"type": "integer", "index": 273, "name": "partner_company_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 274, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 275, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 276, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 277, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 278, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 279, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 280, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 281, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 282, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 283, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 284, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "integer", "index": 285, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 286, "name": "sales_email_opt_out_date_time_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 287, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 288, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_net_suite_sync_error_c": {"type": "integer", "index": 289, "name": "celigo_sfnsio_net_suite_sync_error_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "integer", "index": 290, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "integer", "index": 291, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 292, "name": "ironclad_workflow_c", "comment": null}, "last_sales_activity_date_time_c": {"type": "integer", "index": 293, "name": "last_sales_activity_date_time_c", "comment": null}, "user_activity_logged_by_c": {"type": "integer", "index": 294, "name": "user_activity_logged_by_c", "comment": null}, "first_activity_after_mql_date_c": {"type": "integer", "index": 295, "name": "first_activity_after_mql_date_c", "comment": null}, "last_sdr_activity_owner_c": {"type": "integer", "index": 296, "name": "last_sdr_activity_owner_c", "comment": null}, "last_sdr_activity_date_c": {"type": "integer", "index": 297, "name": "last_sdr_activity_date_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 298, "name": "beta_connector_interest_c", "comment": null}, "first_manual_activity_after_mql_date_c": {"type": "integer", "index": 299, "name": "first_manual_activity_after_mql_date_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 300, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 301, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "integer", "index": 302, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 303, "name": "free_trial_email_confirmed_date_c", "comment": null}, "routed_from_manual_bdr_ae_activity_c": {"type": "integer", "index": 304, "name": "routed_from_manual_bdr_ae_activity_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 305, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "i_sell_avention_id_c": {"type": "integer", "index": 306, "name": "i_sell_avention_id_c", "comment": null}, "persona_c": {"type": "integer", "index": 307, "name": "persona_c", "comment": null}, "last_marketing_interesting_moment_date_c": {"type": "integer", "index": 308, "name": "last_marketing_interesting_moment_date_c", "comment": null}, "verified_c": {"type": "integer", "index": 309, "name": "verified_c", "comment": null}, "salesloft_owner_c": {"type": "integer", "index": 310, "name": "salesloft_owner_c", "comment": null}, "salesloft_owner_sf_c": {"type": "integer", "index": 311, "name": "salesloft_owner_sf_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 312, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_primary_role_c": {"type": "integer", "index": 313, "name": "pbf_startup_primary_role_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "integer", "index": 314, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 315, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 316, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 317, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 318, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 319, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 320, "name": "engagio_role_c", "comment": null}, "mql_date_changed_c": {"type": "integer", "index": 321, "name": "mql_date_changed_c", "comment": null}, "first_activity_after_mql_changed_c": {"type": "integer", "index": 322, "name": "first_activity_after_mql_changed_c", "comment": null}, "birthdate": {"type": "timestamp without time zone", "index": 323, "name": "birthdate", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 324, "name": "legacy_hvr_id_c", "comment": null}, "has_opted_out_of_fax": {"type": "integer", "index": 325, "name": "has_opted_out_of_fax", "comment": null}, "other_latitude": {"type": "integer", "index": 326, "name": "other_latitude", "comment": null}, "username_c": {"type": "integer", "index": 327, "name": "username_c", "comment": null}, "assistant_name": {"type": "integer", "index": 328, "name": "assistant_name", "comment": null}, "created_at_c": {"type": "integer", "index": 329, "name": "created_at_c", "comment": null}, "partner_contact_deprecate_c": {"type": "integer", "index": 330, "name": "partner_contact_deprecate_c", "comment": null}, "other_street": {"type": "integer", "index": 331, "name": "other_street", "comment": null}, "other_state": {"type": "integer", "index": 332, "name": "other_state", "comment": null}, "home_phone": {"type": "integer", "index": 333, "name": "home_phone", "comment": null}, "other_city": {"type": "integer", "index": 334, "name": "other_city", "comment": null}, "company_c": {"type": "integer", "index": 335, "name": "company_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 336, "name": "opportunity_c", "comment": null}, "hvr_update_c": {"type": "integer", "index": 337, "name": "hvr_update_c", "comment": null}, "other_phone": {"type": "integer", "index": 338, "name": "other_phone", "comment": null}, "other_geocode_accuracy": {"type": "integer", "index": 339, "name": "other_geocode_accuracy", "comment": null}, "other_postal_code": {"type": "integer", "index": 340, "name": "other_postal_code", "comment": null}, "other_country": {"type": "integer", "index": 341, "name": "other_country", "comment": null}, "assistant_phone": {"type": "integer", "index": 342, "name": "assistant_phone", "comment": null}, "jigsaw": {"type": "integer", "index": 343, "name": "jigsaw", "comment": null}, "avatar_c": {"type": "integer", "index": 344, "name": "avatar_c", "comment": null}, "other_longitude": {"type": "integer", "index": 345, "name": "other_longitude", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 346, "name": "lean_data_status_info_c", "comment": null}, "analytics_id_c": {"type": "integer", "index": 347, "name": "analytics_id_c", "comment": null}, "dnb_primary_address_postal_code_c": {"type": "integer", "index": 348, "name": "dnb_primary_address_postal_code_c", "comment": null}, "dnb_contact_phone_c": {"type": "integer", "index": 349, "name": "dnb_contact_phone_c", "comment": null}, "dnb_email_deliverability_score_c": {"type": "integer", "index": 350, "name": "dnb_email_deliverability_score_c", "comment": null}, "dnb_job_title_c": {"type": "integer", "index": 351, "name": "dnb_job_title_c", "comment": null}, "dnb_email_c": {"type": "integer", "index": 352, "name": "dnb_email_c", "comment": null}, "dnb_primary_address_city_c": {"type": "integer", "index": 353, "name": "dnb_primary_address_city_c", "comment": null}, "dnb_phone_accuracy_score_c": {"type": "integer", "index": 354, "name": "dnb_phone_accuracy_score_c", "comment": null}, "dnb_primary_address_state_province_c": {"type": "integer", "index": 355, "name": "dnb_primary_address_state_province_c", "comment": null}, "dnb_primary_address_state_province_abbre_c": {"type": "integer", "index": 356, "name": "dnb_primary_address_state_province_abbre_c", "comment": null}, "dnb_primary_address_country_region_code_c": {"type": "integer", "index": 357, "name": "dnb_primary_address_country_region_code_c", "comment": null}, "email_opt_in_double_c": {"type": "integer", "index": 358, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 359, "name": "phone_number_catch_all_c", "comment": null}, "contact_owners_manager_stamped_c": {"type": "integer", "index": 360, "name": "contact_owners_manager_stamped_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 361, "name": "fivetran_account_id_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 362, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 363, "name": "utm_id_c", "comment": null}, "self_service_routing_c": {"type": "integer", "index": 364, "name": "self_service_routing_c", "comment": null}, "no_geo_data_c": {"type": "integer", "index": 365, "name": "no_geo_data_c", "comment": null}, "to_be_deleted_salesloft_backfill_c": {"type": "integer", "index": 366, "name": "to_be_deleted_salesloft_backfill_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 367, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 368, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.contact"}, "source.salesforce_source.salesforce_history.contact": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "id": {"type": "text", "index": 4, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 6, "name": "account_id", "comment": null}, "email": {"type": "text", "index": 7, "name": "email", "comment": null}, "first_name": {"type": "text", "index": 8, "name": "first_name", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 10, "name": "last_activity_date", "comment": null}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": null}, "last_name": {"type": "text", "index": 13, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "integer", "index": 14, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": null}, "mailing_city": {"type": "text", "index": 16, "name": "mailing_city", "comment": null}, "mailing_country": {"type": "text", "index": 17, "name": "mailing_country", "comment": null}, "mailing_country_code": {"type": "text", "index": 18, "name": "mailing_country_code", "comment": null}, "mailing_postal_code": {"type": "integer", "index": 19, "name": "mailing_postal_code", "comment": null}, "mailing_state": {"type": "text", "index": 20, "name": "mailing_state", "comment": null}, "mailing_street": {"type": "text", "index": 21, "name": "mailing_street", "comment": null}, "master_record_id": {"type": "integer", "index": 22, "name": "master_record_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 23, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 24, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": null}, "phone": {"type": "text", "index": 26, "name": "phone", "comment": null}, "reports_to_id": {"type": "integer", "index": 27, "name": "reports_to_id", "comment": null}, "title": {"type": "text", "index": 28, "name": "title", "comment": null}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": null}, "description": {"type": "text", "index": 30, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 31, "name": "individual_id", "comment": null}, "home_phone": {"type": "integer", "index": 32, "name": "home_phone", "comment": null}}, "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.salesforce_source.salesforce_history.contact"}, "source.salesforce_source.salesforce.event": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": null}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": null}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "duration_in_minutes": {"type": "integer", "index": 9, "name": "duration_in_minutes", "comment": null}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": null}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": null}, "group_event_type": {"type": "integer", "index": 12, "name": "group_event_type", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 13, "name": "invitee_uuid_c", "comment": null}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": null}, "is_private": {"type": "boolean", "index": 17, "name": "is_private", "comment": null}, "is_recurrence": {"type": "boolean", "index": 18, "name": "is_recurrence", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 19, "name": "is_reminder_set", "comment": null}, "last_modified_by_id": {"type": "text", "index": 20, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 21, "name": "last_modified_date", "comment": null}, "location": {"type": "integer", "index": 22, "name": "location", "comment": null}, "no_show_c": {"type": "boolean", "index": 23, "name": "no_show_c", "comment": null}, "owner_id": {"type": "text", "index": 24, "name": "owner_id", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 25, "name": "recurrence_activity_id", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 26, "name": "recurrence_day_of_month", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 27, "name": "recurrence_day_of_week_mask", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 28, "name": "recurrence_end_date_only", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "recurrence_interval": {"type": "integer", "index": 30, "name": "recurrence_interval", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 31, "name": "recurrence_month_of_year", "comment": null}, "recurrence_start_date_time": {"type": "timestamp without time zone", "index": 32, "name": "recurrence_start_date_time", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 33, "name": "recurrence_time_zone_sid_key", "comment": null}, "recurrence_type": {"type": "integer", "index": 34, "name": "recurrence_type", "comment": null}, "referral_account_c": {"type": "integer", "index": 35, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 36, "name": "referral_contact_c", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 37, "name": "reminder_date_time", "comment": null}, "show_as": {"type": "text", "index": 38, "name": "show_as", "comment": null}, "start_date_time": {"type": "timestamp without time zone", "index": 39, "name": "start_date_time", "comment": null}, "subject": {"type": "text", "index": 40, "name": "subject", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 41, "name": "system_modstamp", "comment": null}, "type": {"type": "text", "index": 42, "name": "type", "comment": null}, "what_count": {"type": "integer", "index": 43, "name": "what_count", "comment": null}, "what_id": {"type": "text", "index": 44, "name": "what_id", "comment": null}, "who_count": {"type": "integer", "index": 45, "name": "who_count", "comment": null}, "who_id": {"type": "text", "index": 46, "name": "who_id", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 47, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 48, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 49, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 50, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 52, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 53, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 54, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 55, "name": "lid_date_sent_c", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "is_recurrence_2": {"type": "boolean", "index": 78, "name": "is_recurrence_2", "comment": null}, "is_recurrence_2_exception": {"type": "boolean", "index": 79, "name": "is_recurrence_2_exception", "comment": null}, "is_recurrence_2_exclusion": {"type": "boolean", "index": 80, "name": "is_recurrence_2_exclusion", "comment": null}, "recurrence_2_pattern_start_date": {"type": "timestamp without time zone", "index": 81, "name": "recurrence_2_pattern_start_date", "comment": null}, "recurrence_2_pattern_text": {"type": "integer", "index": 82, "name": "recurrence_2_pattern_text", "comment": null}, "recurrence_2_pattern_time_zone": {"type": "integer", "index": 83, "name": "recurrence_2_pattern_time_zone", "comment": null}, "recurrence_2_pattern_version": {"type": "integer", "index": 84, "name": "recurrence_2_pattern_version", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 85, "name": "co_selling_activity_c", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 86, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 87, "name": "partner_contact_c", "comment": null}, "description_c": {"type": "integer", "index": 88, "name": "description_c", "comment": null}, "campaign_c": {"type": "integer", "index": 89, "name": "campaign_c", "comment": null}, "event_name_c": {"type": "integer", "index": 90, "name": "event_name_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 91, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 92, "name": "topic_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 93, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 94, "name": "partner_activity_type_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 95, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 96, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 97, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 98, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 99, "name": "vidyard_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 100, "name": "collections_hold_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 101, "name": "execute_collections_plan_activity_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 102, "name": "expected_payment_date_c", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 103, "name": "end_date", "comment": null}, "opportunity_c": {"type": "integer", "index": 104, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "integer", "index": 105, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "integer", "index": 106, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 107, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 108, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "integer", "index": 109, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "integer", "index": 110, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 111, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 112, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 113, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.event"}, "source.salesforce_source.salesforce.lead": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"country": {"type": "integer", "index": 1, "name": "country", "comment": null}, "email_bounced_reason": {"type": "integer", "index": 2, "name": "email_bounced_reason", "comment": null}, "email_bounced_date": {"type": "timestamp without time zone", "index": 3, "name": "email_bounced_date", "comment": null}, "owner_id": {"type": "text", "index": 4, "name": "owner_id", "comment": null}, "secondary_email_c": {"type": "integer", "index": 5, "name": "secondary_email_c", "comment": null}, "lead_source": {"type": "integer", "index": 6, "name": "lead_source", "comment": null}, "converted_date": {"type": "timestamp without time zone", "index": 7, "name": "converted_date", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": null}, "master_record_id": {"type": "integer", "index": 9, "name": "master_record_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 12, "name": "geocode_accuracy", "comment": null}, "converted_contact_id": {"type": "text", "index": 13, "name": "converted_contact_id", "comment": null}, "up_region_c": {"type": "integer", "index": 14, "name": "up_region_c", "comment": null}, "id": {"type": "text", "index": 15, "name": "id", "comment": null}, "photo_url": {"type": "text", "index": 16, "name": "photo_url", "comment": null}, "state": {"type": "integer", "index": 17, "name": "state", "comment": null}, "longitude": {"type": "integer", "index": 18, "name": "longitude", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 19, "name": "last_referenced_date", "comment": null}, "up_district_c": {"type": "integer", "index": 20, "name": "up_district_c", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": null}, "country_code": {"type": "integer", "index": 22, "name": "country_code", "comment": null}, "phone": {"type": "integer", "index": 23, "name": "phone", "comment": null}, "mc_4_sf_mc_subscriber_c": {"type": "integer", "index": 24, "name": "mc_4_sf_mc_subscriber_c", "comment": null}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "jigsaw_contact_id": {"type": "integer", "index": 26, "name": "jigsaw_contact_id", "comment": null}, "lead_source_detail_c": {"type": "integer", "index": 27, "name": "lead_source_detail_c", "comment": null}, "created_by_id": {"type": "text", "index": 28, "name": "created_by_id", "comment": null}, "salutation": {"type": "integer", "index": 29, "name": "salutation", "comment": null}, "is_converted": {"type": "boolean", "index": 30, "name": "is_converted", "comment": null}, "state_code": {"type": "integer", "index": 31, "name": "state_code", "comment": null}, "is_unread_by_owner": {"type": "boolean", "index": 32, "name": "is_unread_by_owner", "comment": null}, "status": {"type": "text", "index": 33, "name": "status", "comment": null}, "city": {"type": "integer", "index": 34, "name": "city", "comment": null}, "latitude": {"type": "integer", "index": 35, "name": "latitude", "comment": null}, "cbit_clearbit_c": {"type": "integer", "index": 36, "name": "cbit_clearbit_c", "comment": null}, "industry": {"type": "text", "index": 37, "name": "industry", "comment": null}, "title": {"type": "integer", "index": 38, "name": "title", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 39, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 40, "name": "last_viewed_date", "comment": null}, "converted_opportunity_id": {"type": "integer", "index": 41, "name": "converted_opportunity_id", "comment": null}, "is_deleted": {"type": "boolean", "index": 42, "name": "is_deleted", "comment": null}, "street": {"type": "integer", "index": 43, "name": "street", "comment": null}, "company": {"type": "text", "index": 44, "name": "company", "comment": null}, "first_name": {"type": "text", "index": 45, "name": "first_name", "comment": null}, "email": {"type": "text", "index": 46, "name": "email", "comment": null}, "website": {"type": "integer", "index": 47, "name": "website", "comment": null}, "last_name": {"type": "text", "index": 48, "name": "last_name", "comment": null}, "number_of_employees": {"type": "integer", "index": 49, "name": "number_of_employees", "comment": null}, "up_territory_c": {"type": "integer", "index": 50, "name": "up_territory_c", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 51, "name": "created_date", "comment": null}, "gclid_c": {"type": "integer", "index": 52, "name": "gclid_c", "comment": null}, "active_in_sequence_c": {"type": "boolean", "index": 53, "name": "active_in_sequence_c", "comment": null}, "postal_code": {"type": "integer", "index": 54, "name": "postal_code", "comment": null}, "cbit_clearbit_ready_c": {"type": "boolean", "index": 55, "name": "cbit_clearbit_ready_c", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 56, "name": "has_opted_out_of_email", "comment": null}, "converted_account_id": {"type": "text", "index": 57, "name": "converted_account_id", "comment": null}, "mobile_phone": {"type": "integer", "index": 58, "name": "mobile_phone", "comment": null}, "calendly_created_c": {"type": "integer", "index": 59, "name": "calendly_created_c", "comment": null}, "account_c": {"type": "integer", "index": 60, "name": "account_c", "comment": null}, "all_connectors_c": {"type": "integer", "index": 61, "name": "all_connectors_c", "comment": null}, "all_data_warehouses_c": {"type": "integer", "index": 62, "name": "all_data_warehouses_c", "comment": null}, "bi_tools_c": {"type": "integer", "index": 63, "name": "bi_tools_c", "comment": null}, "competitors_c": {"type": "integer", "index": 64, "name": "competitors_c", "comment": null}, "annual_revenue": {"type": "integer", "index": 65, "name": "annual_revenue", "comment": null}, "connectors_products_c": {"type": "integer", "index": 66, "name": "connectors_products_c", "comment": null}, "contact_c": {"type": "integer", "index": 67, "name": "contact_c", "comment": null}, "data_warehouse_products_c": {"type": "integer", "index": 68, "name": "data_warehouse_products_c", "comment": null}, "notes_c": {"type": "integer", "index": 69, "name": "notes_c", "comment": null}, "timeframe_c": {"type": "integer", "index": 70, "name": "timeframe_c", "comment": null}, "account_all_products_c": {"type": "integer", "index": 71, "name": "account_all_products_c", "comment": null}, "account_bi_tools_c": {"type": "integer", "index": 72, "name": "account_bi_tools_c", "comment": null}, "account_data_warehouses_c": {"type": "integer", "index": 73, "name": "account_data_warehouses_c", "comment": null}, "opportunity_competitors_c": {"type": "integer", "index": 74, "name": "opportunity_competitors_c", "comment": null}, "opportunity_products_c": {"type": "integer", "index": 75, "name": "opportunity_products_c", "comment": null}, "description": {"type": "integer", "index": 76, "name": "description", "comment": null}, "referral_account_c": {"type": "integer", "index": 77, "name": "referral_account_c", "comment": null}, "referral_contact_c": {"type": "integer", "index": 78, "name": "referral_contact_c", "comment": null}, "volume_in_millions_c": {"type": "integer", "index": 79, "name": "volume_in_millions_c", "comment": null}, "feature_requests_c": {"type": "integer", "index": 80, "name": "feature_requests_c", "comment": null}, "lead_number_c": {"type": "integer", "index": 81, "name": "lead_number_c", "comment": null}, "demo_scheduled_by_calenderly_c": {"type": "boolean", "index": 82, "name": "demo_scheduled_by_calenderly_c", "comment": null}, "to_delete_c": {"type": "boolean", "index": 83, "name": "to_delete_c", "comment": null}, "bounced_email_c": {"type": "integer", "index": 84, "name": "bounced_email_c", "comment": null}, "email_quality_c": {"type": "boolean", "index": 85, "name": "email_quality_c", "comment": null}, "email_quality_catchall_c": {"type": "integer", "index": 86, "name": "email_quality_catchall_c", "comment": null}, "old_lead_source_c": {"type": "integer", "index": 87, "name": "old_lead_source_c", "comment": null}, "email_bounced_c": {"type": "boolean", "index": 88, "name": "email_bounced_c", "comment": null}, "old_lead_source_detail_c": {"type": "integer", "index": 89, "name": "old_lead_source_detail_c", "comment": null}, "utm_medium_c": {"type": "integer", "index": 90, "name": "utm_medium_c", "comment": null}, "utm_source_c": {"type": "integer", "index": 91, "name": "utm_source_c", "comment": null}, "utm_campaign_c": {"type": "integer", "index": 92, "name": "utm_campaign_c", "comment": null}, "utm_content_c": {"type": "integer", "index": 93, "name": "utm_content_c", "comment": null}, "utm_term_c": {"type": "integer", "index": 94, "name": "utm_term_c", "comment": null}, "act_on_lead_score_c": {"type": "integer", "index": 95, "name": "act_on_lead_score_c", "comment": null}, "cbit_created_by_clearbit_c": {"type": "boolean", "index": 96, "name": "cbit_created_by_clearbit_c", "comment": null}, "fivetran_user_id_c": {"type": "integer", "index": 97, "name": "fivetran_user_id_c", "comment": null}, "geo_state_acton_c": {"type": "integer", "index": 98, "name": "geo_state_acton_c", "comment": null}, "actoncountry_c": {"type": "integer", "index": 99, "name": "actoncountry_c", "comment": null}, "actoncity_c": {"type": "integer", "index": 100, "name": "actoncity_c", "comment": null}, "actoncountrycode_c": {"type": "integer", "index": 101, "name": "actoncountrycode_c", "comment": null}, "actonpostalcode_c": {"type": "integer", "index": 102, "name": "actonpostalcode_c", "comment": null}, "actonreferrer_c": {"type": "integer", "index": 103, "name": "actonreferrer_c", "comment": null}, "actonstate_c": {"type": "integer", "index": 104, "name": "actonstate_c", "comment": null}, "geo_city_c": {"type": "integer", "index": 105, "name": "geo_city_c", "comment": null}, "geo_country_c": {"type": "integer", "index": 106, "name": "geo_country_c", "comment": null}, "geo_country_code_c": {"type": "integer", "index": 107, "name": "geo_country_code_c", "comment": null}, "geo_postal_code_c": {"type": "integer", "index": 108, "name": "geo_postal_code_c", "comment": null}, "geo_state_c": {"type": "integer", "index": 109, "name": "geo_state_c", "comment": null}, "company_type_c": {"type": "integer", "index": 110, "name": "company_type_c", "comment": null}, "pi_campaign_c": {"type": "integer", "index": 111, "name": "pi_campaign_c", "comment": null}, "pi_comments_c": {"type": "integer", "index": 112, "name": "pi_comments_c", "comment": null}, "pi_conversion_date_c": {"type": "integer", "index": 113, "name": "pi_conversion_date_c", "comment": null}, "pi_conversion_object_name_c": {"type": "integer", "index": 114, "name": "pi_conversion_object_name_c", "comment": null}, "pi_conversion_object_type_c": {"type": "integer", "index": 115, "name": "pi_conversion_object_type_c", "comment": null}, "pi_created_date_c": {"type": "integer", "index": 116, "name": "pi_created_date_c", "comment": null}, "pi_first_activity_c": {"type": "integer", "index": 117, "name": "pi_first_activity_c", "comment": null}, "pi_first_search_term_c": {"type": "integer", "index": 118, "name": "pi_first_search_term_c", "comment": null}, "pi_first_search_type_c": {"type": "integer", "index": 119, "name": "pi_first_search_type_c", "comment": null}, "pi_first_touch_url_c": {"type": "integer", "index": 120, "name": "pi_first_touch_url_c", "comment": null}, "pi_grade_c": {"type": "integer", "index": 121, "name": "pi_grade_c", "comment": null}, "pi_last_activity_c": {"type": "integer", "index": 122, "name": "pi_last_activity_c", "comment": null}, "pi_needs_score_synced_c": {"type": "integer", "index": 123, "name": "pi_needs_score_synced_c", "comment": null}, "pi_notes_c": {"type": "integer", "index": 124, "name": "pi_notes_c", "comment": null}, "pi_pardot_hard_bounced_c": {"type": "integer", "index": 125, "name": "pi_pardot_hard_bounced_c", "comment": null}, "pi_pardot_last_scored_at_c": {"type": "integer", "index": 126, "name": "pi_pardot_last_scored_at_c", "comment": null}, "pi_score_c": {"type": "integer", "index": 127, "name": "pi_score_c", "comment": null}, "pi_url_c": {"type": "integer", "index": 128, "name": "pi_url_c", "comment": null}, "pi_utm_campaign_c": {"type": "integer", "index": 129, "name": "pi_utm_campaign_c", "comment": null}, "pi_utm_content_c": {"type": "integer", "index": 130, "name": "pi_utm_content_c", "comment": null}, "pi_utm_medium_c": {"type": "integer", "index": 131, "name": "pi_utm_medium_c", "comment": null}, "pi_utm_source_c": {"type": "integer", "index": 132, "name": "pi_utm_source_c", "comment": null}, "pi_utm_term_c": {"type": "integer", "index": 133, "name": "pi_utm_term_c", "comment": null}, "fax": {"type": "integer", "index": 134, "name": "fax", "comment": null}, "region_c": {"type": "integer", "index": 135, "name": "region_c", "comment": null}, "competitor_c": {"type": "boolean", "index": 136, "name": "competitor_c", "comment": null}, "source_detail_c": {"type": "integer", "index": 137, "name": "source_detail_c", "comment": null}, "fivetran_account_stage_c": {"type": "integer", "index": 138, "name": "fivetran_account_stage_c", "comment": null}, "fivetran_account_id_c": {"type": "integer", "index": 139, "name": "fivetran_account_id_c", "comment": null}, "lean_data_router_status_c": {"type": "integer", "index": 140, "name": "lean_data_router_status_c", "comment": null}, "lean_data_matched_lead_c": {"type": "integer", "index": 141, "name": "lean_data_matched_lead_c", "comment": null}, "lean_data_routing_action_c": {"type": "text", "index": 142, "name": "lean_data_routing_action_c", "comment": null}, "lean_data_search_index_c": {"type": "text", "index": 143, "name": "lean_data_search_index_c", "comment": null}, "lean_data_reporting_matched_account_c": {"type": "text", "index": 144, "name": "lean_data_reporting_matched_account_c", "comment": null}, "lean_data_reporting_timestamp_c": {"type": "timestamp without time zone", "index": 145, "name": "lean_data_reporting_timestamp_c", "comment": null}, "lean_data_ld_segment_c": {"type": "integer", "index": 146, "name": "lean_data_ld_segment_c", "comment": null}, "lean_data_marketing_sys_created_date_c": {"type": "integer", "index": 147, "name": "lean_data_marketing_sys_created_date_c", "comment": null}, "lean_data_matched_account_c": {"type": "integer", "index": 148, "name": "lean_data_matched_account_c", "comment": null}, "lean_data_a_2_b_account_c": {"type": "integer", "index": 149, "name": "lean_data_a_2_b_account_c", "comment": null}, "lean_data_search_c": {"type": "integer", "index": 150, "name": "lean_data_search_c", "comment": null}, "lean_data_routing_status_c": {"type": "text", "index": 151, "name": "lean_data_routing_status_c", "comment": null}, "lean_data_a_2_b_group_c": {"type": "integer", "index": 152, "name": "lean_data_a_2_b_group_c", "comment": null}, "lean_data_matched_buyer_persona_c": {"type": "integer", "index": 153, "name": "lean_data_matched_buyer_persona_c", "comment": null}, "lean_data_tag_c": {"type": "integer", "index": 154, "name": "lean_data_tag_c", "comment": null}, "lean_data_status_info_c": {"type": "integer", "index": 155, "name": "lean_data_status_info_c", "comment": null}, "lean_data_modified_score_c": {"type": "integer", "index": 156, "name": "lean_data_modified_score_c", "comment": null}, "do_not_route_lead_c": {"type": "boolean", "index": 157, "name": "do_not_route_lead_c", "comment": null}, "partner_type_c": {"type": "integer", "index": 158, "name": "partner_type_c", "comment": null}, "allbound_id_c": {"type": "integer", "index": 159, "name": "allbound_id_c", "comment": null}, "lid_linked_in_company_id_c": {"type": "integer", "index": 160, "name": "lid_linked_in_company_id_c", "comment": null}, "lid_linked_in_member_token_c": {"type": "integer", "index": 161, "name": "lid_linked_in_member_token_c", "comment": null}, "lean_data_re_route_c": {"type": "integer", "index": 162, "name": "lean_data_re_route_c", "comment": null}, "sales_loft_1_most_recent_cadence_next_step_due_date_c": {"type": "integer", "index": 163, "name": "sales_loft_1_most_recent_cadence_next_step_due_date_c", "comment": null}, "sales_loft_1_most_recent_last_completed_step_c": {"type": "integer", "index": 164, "name": "sales_loft_1_most_recent_last_completed_step_c", "comment": null}, "sales_loft_1_most_recent_cadence_name_c": {"type": "integer", "index": 165, "name": "sales_loft_1_most_recent_cadence_name_c", "comment": null}, "network_c": {"type": "integer", "index": 166, "name": "network_c", "comment": null}, "matchtype_c": {"type": "integer", "index": 167, "name": "matchtype_c", "comment": null}, "device_c": {"type": "integer", "index": 168, "name": "device_c", "comment": null}, "creative_c": {"type": "integer", "index": 169, "name": "creative_c", "comment": null}, "adgroupid_c": {"type": "integer", "index": 170, "name": "adgroupid_c", "comment": null}, "keyword_c": {"type": "integer", "index": 171, "name": "keyword_c", "comment": null}, "campaignid_c": {"type": "integer", "index": 172, "name": "campaignid_c", "comment": null}, "partner_rep_email_c": {"type": "integer", "index": 173, "name": "partner_rep_email_c", "comment": null}, "partner_rep_name_c": {"type": "integer", "index": 174, "name": "partner_rep_name_c", "comment": null}, "lead_type_c": {"type": "integer", "index": 175, "name": "lead_type_c", "comment": null}, "contact_stage_c": {"type": "text", "index": 176, "name": "contact_stage_c", "comment": null}, "original_utm_campaign_c": {"type": "integer", "index": 177, "name": "original_utm_campaign_c", "comment": null}, "original_utm_content_c": {"type": "integer", "index": 178, "name": "original_utm_content_c", "comment": null}, "original_utm_medium_c": {"type": "integer", "index": 179, "name": "original_utm_medium_c", "comment": null}, "original_utm_source_c": {"type": "integer", "index": 180, "name": "original_utm_source_c", "comment": null}, "original_utm_term_c": {"type": "integer", "index": 181, "name": "original_utm_term_c", "comment": null}, "es_app_esalexa_rank_c": {"type": "integer", "index": 182, "name": "es_app_esalexa_rank_c", "comment": null}, "es_app_esaudience_names_c": {"type": "integer", "index": 183, "name": "es_app_esaudience_names_c", "comment": null}, "es_app_escity_c": {"type": "integer", "index": 184, "name": "es_app_escity_c", "comment": null}, "es_app_escompany_phone_c": {"type": "integer", "index": 185, "name": "es_app_escompany_phone_c", "comment": null}, "es_app_escountry_c": {"type": "integer", "index": 186, "name": "es_app_escountry_c", "comment": null}, "es_app_escreated_timestamp_c": {"type": "integer", "index": 187, "name": "es_app_escreated_timestamp_c", "comment": null}, "es_app_esecid_c": {"type": "integer", "index": 188, "name": "es_app_esecid_c", "comment": null}, "es_app_esemployees_c": {"type": "integer", "index": 189, "name": "es_app_esemployees_c", "comment": null}, "es_app_esenriched_c": {"type": "integer", "index": 190, "name": "es_app_esenriched_c", "comment": null}, "es_app_esenriched_timestamp_c": {"type": "integer", "index": 191, "name": "es_app_esenriched_timestamp_c", "comment": null}, "es_app_esfacebook_c": {"type": "integer", "index": 192, "name": "es_app_esfacebook_c", "comment": null}, "es_app_esindustry_c": {"type": "integer", "index": 193, "name": "es_app_esindustry_c", "comment": null}, "es_app_esintent_aggregate_score_c": {"type": "integer", "index": 194, "name": "es_app_esintent_aggregate_score_c", "comment": null}, "es_app_esintent_timestamp_c": {"type": "integer", "index": 195, "name": "es_app_esintent_timestamp_c", "comment": null}, "es_app_esintent_topics_c": {"type": "integer", "index": 196, "name": "es_app_esintent_topics_c", "comment": null}, "es_app_eskeywords_c": {"type": "integer", "index": 197, "name": "es_app_eskeywords_c", "comment": null}, "es_app_eslinked_in_c": {"type": "integer", "index": 198, "name": "es_app_eslinked_in_c", "comment": null}, "es_app_esoverall_fit_score_c": {"type": "integer", "index": 199, "name": "es_app_esoverall_fit_score_c", "comment": null}, "es_app_esrevenue_c": {"type": "integer", "index": 200, "name": "es_app_esrevenue_c", "comment": null}, "es_app_essource_c": {"type": "integer", "index": 201, "name": "es_app_essource_c", "comment": null}, "es_app_esstate_c": {"type": "integer", "index": 202, "name": "es_app_esstate_c", "comment": null}, "es_app_esstreet_c": {"type": "integer", "index": 203, "name": "es_app_esstreet_c", "comment": null}, "es_app_estechnologies_c": {"type": "integer", "index": 204, "name": "es_app_estechnologies_c", "comment": null}, "es_app_estwitter_c": {"type": "integer", "index": 205, "name": "es_app_estwitter_c", "comment": null}, "es_app_eszipcode_c": {"type": "integer", "index": 206, "name": "es_app_eszipcode_c", "comment": null}, "marketing_prospect_routing_rules_c": {"type": "boolean", "index": 207, "name": "marketing_prospect_routing_rules_c", "comment": null}, "individual_id": {"type": "integer", "index": 208, "name": "individual_id", "comment": null}, "marketing_process_c": {"type": "integer", "index": 209, "name": "marketing_process_c", "comment": null}, "automation_tracking_c": {"type": "integer", "index": 210, "name": "automation_tracking_c", "comment": null}, "user_gems_has_changed_job_c": {"type": "integer", "index": 211, "name": "user_gems_has_changed_job_c", "comment": null}, "user_gems_linked_in_c": {"type": "integer", "index": 212, "name": "user_gems_linked_in_c", "comment": null}, "email_opt_in_c": {"type": "integer", "index": 213, "name": "email_opt_in_c", "comment": null}, "email_opt_in_explicit_c": {"type": "boolean", "index": 214, "name": "email_opt_in_explicit_c", "comment": null}, "email_opt_in_implicit_c": {"type": "boolean", "index": 215, "name": "email_opt_in_implicit_c", "comment": null}, "gdpr_opt_in_explicit_c": {"type": "boolean", "index": 216, "name": "gdpr_opt_in_explicit_c", "comment": null}, "user_gems_is_a_user_gem_c": {"type": "boolean", "index": 217, "name": "user_gems_is_a_user_gem_c", "comment": null}, "user_gems_past_account_c": {"type": "integer", "index": 218, "name": "user_gems_past_account_c", "comment": null}, "user_gems_past_company_c": {"type": "integer", "index": 219, "name": "user_gems_past_company_c", "comment": null}, "user_gems_past_contact_c": {"type": "integer", "index": 220, "name": "user_gems_past_contact_c", "comment": null}, "user_gems_past_title_c": {"type": "integer", "index": 221, "name": "user_gems_past_title_c", "comment": null}, "promotion_id_c": {"type": "integer", "index": 222, "name": "promotion_id_c", "comment": null}, "previous_customer_c": {"type": "integer", "index": 223, "name": "previous_customer_c", "comment": null}, "referral_contact_email_c": {"type": "integer", "index": 224, "name": "referral_contact_email_c", "comment": null}, "referral_firstname_c": {"type": "integer", "index": 225, "name": "referral_firstname_c", "comment": null}, "referral_last_name_c": {"type": "integer", "index": 226, "name": "referral_last_name_c", "comment": null}, "mkto_71_lead_score_c": {"type": "integer", "index": 227, "name": "mkto_71_lead_score_c", "comment": null}, "mkto_71_acquisition_date_c": {"type": "integer", "index": 228, "name": "mkto_71_acquisition_date_c", "comment": null}, "mkto_71_acquisition_program_id_c": {"type": "integer", "index": 229, "name": "mkto_71_acquisition_program_id_c", "comment": null}, "mkto_acquisition_program_c": {"type": "integer", "index": 230, "name": "mkto_acquisition_program_c", "comment": null}, "mkto_71_inferred_city_c": {"type": "integer", "index": 231, "name": "mkto_71_inferred_city_c", "comment": null}, "mkto_71_inferred_company_c": {"type": "integer", "index": 232, "name": "mkto_71_inferred_company_c", "comment": null}, "mkto_71_inferred_country_c": {"type": "integer", "index": 233, "name": "mkto_71_inferred_country_c", "comment": null}, "mkto_71_inferred_metropolitan_area_c": {"type": "integer", "index": 234, "name": "mkto_71_inferred_metropolitan_area_c", "comment": null}, "mkto_71_inferred_phone_area_code_c": {"type": "integer", "index": 235, "name": "mkto_71_inferred_phone_area_code_c", "comment": null}, "mkto_71_inferred_postal_code_c": {"type": "integer", "index": 236, "name": "mkto_71_inferred_postal_code_c", "comment": null}, "mkto_71_inferred_state_region_c": {"type": "integer", "index": 237, "name": "mkto_71_inferred_state_region_c", "comment": null}, "mkto_71_original_referrer_c": {"type": "integer", "index": 238, "name": "mkto_71_original_referrer_c", "comment": null}, "mkto_71_original_search_engine_c": {"type": "integer", "index": 239, "name": "mkto_71_original_search_engine_c", "comment": null}, "mkto_71_original_search_phrase_c": {"type": "integer", "index": 240, "name": "mkto_71_original_search_phrase_c", "comment": null}, "mkto_71_original_source_info_c": {"type": "integer", "index": 241, "name": "mkto_71_original_source_info_c", "comment": null}, "mkto_71_original_source_type_c": {"type": "integer", "index": 242, "name": "mkto_71_original_source_type_c", "comment": null}, "mkto_si_hide_date_c": {"type": "integer", "index": 243, "name": "mkto_si_hide_date_c", "comment": null}, "mkto_si_last_interesting_moment_date_c": {"type": "timestamp without time zone", "index": 244, "name": "mkto_si_last_interesting_moment_date_c", "comment": null}, "mkto_si_last_interesting_moment_desc_c": {"type": "text", "index": 245, "name": "mkto_si_last_interesting_moment_desc_c", "comment": null}, "mkto_si_last_interesting_moment_source_c": {"type": "text", "index": 246, "name": "mkto_si_last_interesting_moment_source_c", "comment": null}, "mkto_si_last_interesting_moment_type_c": {"type": "text", "index": 247, "name": "mkto_si_last_interesting_moment_type_c", "comment": null}, "mkto_si_msicontact_id_c": {"type": "integer", "index": 248, "name": "mkto_si_msicontact_id_c", "comment": null}, "mkto_si_priority_c": {"type": "integer", "index": 249, "name": "mkto_si_priority_c", "comment": null}, "mkto_si_relative_score_value_c": {"type": "integer", "index": 250, "name": "mkto_si_relative_score_value_c", "comment": null}, "mkto_si_urgency_value_c": {"type": "integer", "index": 251, "name": "mkto_si_urgency_value_c", "comment": null}, "cloudingo_agent_ar_c": {"type": "integer", "index": 252, "name": "cloudingo_agent_ar_c", "comment": null}, "cloudingo_agent_ardi_c": {"type": "integer", "index": 253, "name": "cloudingo_agent_ardi_c", "comment": null}, "cloudingo_agent_as_c": {"type": "integer", "index": 254, "name": "cloudingo_agent_as_c", "comment": null}, "cloudingo_agent_atz_c": {"type": "integer", "index": 255, "name": "cloudingo_agent_atz_c", "comment": null}, "cloudingo_agent_av_c": {"type": "integer", "index": 256, "name": "cloudingo_agent_av_c", "comment": null}, "cloudingo_agent_les_c": {"type": "integer", "index": 257, "name": "cloudingo_agent_les_c", "comment": null}, "do_not_sync_marketo_c": {"type": "boolean", "index": 258, "name": "do_not_sync_marketo_c", "comment": null}, "source_every_utm_campaign_c": {"type": "integer", "index": 259, "name": "source_every_utm_campaign_c", "comment": null}, "source_every_utm_content_c": {"type": "integer", "index": 260, "name": "source_every_utm_content_c", "comment": null}, "source_every_utm_medium_c": {"type": "integer", "index": 261, "name": "source_every_utm_medium_c", "comment": null}, "source_every_utm_source_c": {"type": "integer", "index": 262, "name": "source_every_utm_source_c", "comment": null}, "source_every_utm_term_c": {"type": "integer", "index": 263, "name": "source_every_utm_term_c", "comment": null}, "source_first_utm_campaign_c": {"type": "integer", "index": 264, "name": "source_first_utm_campaign_c", "comment": null}, "source_first_utm_content_c": {"type": "integer", "index": 265, "name": "source_first_utm_content_c", "comment": null}, "source_first_utm_medium_c": {"type": "integer", "index": 266, "name": "source_first_utm_medium_c", "comment": null}, "source_first_utm_source_c": {"type": "integer", "index": 267, "name": "source_first_utm_source_c", "comment": null}, "source_first_utm_term_c": {"type": "integer", "index": 268, "name": "source_first_utm_term_c", "comment": null}, "source_last_utm_campaign_c": {"type": "text", "index": 269, "name": "source_last_utm_campaign_c", "comment": null}, "source_last_utm_content_c": {"type": "text", "index": 270, "name": "source_last_utm_content_c", "comment": null}, "source_last_utm_medium_c": {"type": "text", "index": 271, "name": "source_last_utm_medium_c", "comment": null}, "source_last_utm_source_c": {"type": "text", "index": 272, "name": "source_last_utm_source_c", "comment": null}, "source_last_utm_term_c": {"type": "text", "index": 273, "name": "source_last_utm_term_c", "comment": null}, "direct_office_c": {"type": "integer", "index": 274, "name": "direct_office_c", "comment": null}, "city_c": {"type": "integer", "index": 275, "name": "city_c", "comment": null}, "country_c": {"type": "integer", "index": 276, "name": "country_c", "comment": null}, "state_c": {"type": "integer", "index": 277, "name": "state_c", "comment": null}, "source_first_lead_source_category_c": {"type": "integer", "index": 278, "name": "source_first_lead_source_category_c", "comment": null}, "source_last_lead_source_c": {"type": "integer", "index": 279, "name": "source_last_lead_source_c", "comment": null}, "source_last_lead_source_category_c": {"type": "integer", "index": 280, "name": "source_last_lead_source_category_c", "comment": null}, "source_last_lead_source_detail_c": {"type": "integer", "index": 281, "name": "source_last_lead_source_detail_c", "comment": null}, "source_every_lead_source_c": {"type": "integer", "index": 282, "name": "source_every_lead_source_c", "comment": null}, "source_every_lead_source_category_c": {"type": "integer", "index": 283, "name": "source_every_lead_source_category_c", "comment": null}, "source_every_lead_source_detail_c": {"type": "integer", "index": 284, "name": "source_every_lead_source_detail_c", "comment": null}, "source_first_lead_source_c": {"type": "integer", "index": 285, "name": "source_first_lead_source_c", "comment": null}, "source_first_lead_source_detail_c": {"type": "integer", "index": 286, "name": "source_first_lead_source_detail_c", "comment": null}, "behavioral_score_c": {"type": "integer", "index": 287, "name": "behavioral_score_c", "comment": null}, "demographic_score_c": {"type": "integer", "index": 288, "name": "demographic_score_c", "comment": null}, "drift_cql_c": {"type": "integer", "index": 289, "name": "drift_cql_c", "comment": null}, "unique_email_c": {"type": "integer", "index": 290, "name": "unique_email_c", "comment": null}, "is_emea_event_routing_c": {"type": "boolean", "index": 291, "name": "is_emea_event_routing_c", "comment": null}, "csi_code_c": {"type": "integer", "index": 292, "name": "csi_code_c", "comment": null}, "csi_description_c": {"type": "text", "index": 293, "name": "csi_description_c", "comment": null}, "converted_date_time_c": {"type": "timestamp without time zone", "index": 294, "name": "converted_date_time_c", "comment": null}, "lead_created_date_time_reporting_c": {"type": "timestamp without time zone", "index": 295, "name": "lead_created_date_time_reporting_c", "comment": null}, "lead_iq_country_c": {"type": "integer", "index": 296, "name": "lead_iq_country_c", "comment": null}, "lead_iq_employee_count_c": {"type": "integer", "index": 297, "name": "lead_iq_employee_count_c", "comment": null}, "lead_iq_employee_range_c": {"type": "integer", "index": 298, "name": "lead_iq_employee_range_c", "comment": null}, "lead_iq_state_c": {"type": "integer", "index": 299, "name": "lead_iq_state_c", "comment": null}, "lead_iq_zip_code_c": {"type": "integer", "index": 300, "name": "lead_iq_zip_code_c", "comment": null}, "zoominfo_country_c": {"type": "integer", "index": 301, "name": "zoominfo_country_c", "comment": null}, "zoominfo_employee_count_c": {"type": "integer", "index": 302, "name": "zoominfo_employee_count_c", "comment": null}, "zoominfo_state_c": {"type": "integer", "index": 303, "name": "zoominfo_state_c", "comment": null}, "zoominfo_technologies_c": {"type": "integer", "index": 304, "name": "zoominfo_technologies_c", "comment": null}, "zoominfo_zip_code_c": {"type": "integer", "index": 305, "name": "zoominfo_zip_code_c", "comment": null}, "attended_event_c": {"type": "boolean", "index": 306, "name": "attended_event_c", "comment": null}, "mql_date_c": {"type": "integer", "index": 307, "name": "mql_date_c", "comment": null}, "user_gems_user_gems_id_c": {"type": "integer", "index": 308, "name": "user_gems_user_gems_id_c", "comment": null}, "dozisf_zoom_info_company_id_c": {"type": "integer", "index": 309, "name": "dozisf_zoom_info_company_id_c", "comment": null}, "dozisf_zoom_info_first_updated_c": {"type": "integer", "index": 310, "name": "dozisf_zoom_info_first_updated_c", "comment": null}, "dozisf_zoom_info_id_c": {"type": "integer", "index": 311, "name": "dozisf_zoom_info_id_c", "comment": null}, "dozisf_zoom_info_last_updated_c": {"type": "integer", "index": 312, "name": "dozisf_zoom_info_last_updated_c", "comment": null}, "lean_data_manual_route_trigger_c": {"type": "boolean", "index": 313, "name": "lean_data_manual_route_trigger_c", "comment": null}, "first_mql_date_c": {"type": "integer", "index": 314, "name": "first_mql_date_c", "comment": null}, "fivetran_account_association_date_c": {"type": "integer", "index": 315, "name": "fivetran_account_association_date_c", "comment": null}, "fivetran_account_user_role_s_c": {"type": "integer", "index": 316, "name": "fivetran_account_user_role_s_c", "comment": null}, "mql_reason_c": {"type": "text", "index": 317, "name": "mql_reason_c", "comment": null}, "trial_contact_start_date_c": {"type": "integer", "index": 318, "name": "trial_contact_start_date_c", "comment": null}, "enrichment_request_c": {"type": "boolean", "index": 319, "name": "enrichment_request_c", "comment": null}, "meta_data_create_date_c": {"type": "timestamp without time zone", "index": 320, "name": "meta_data_create_date_c", "comment": null}, "clarus_date_c": {"type": "integer", "index": 321, "name": "clarus_date_c", "comment": null}, "clarus_editor_c": {"type": "integer", "index": 322, "name": "clarus_editor_c", "comment": null}, "clarus_notes_c": {"type": "integer", "index": 323, "name": "clarus_notes_c", "comment": null}, "clarus_project_c": {"type": "integer", "index": 324, "name": "clarus_project_c", "comment": null}, "clarus_status_c": {"type": "integer", "index": 325, "name": "clarus_status_c", "comment": null}, "marketing_connector_interest_c": {"type": "integer", "index": 326, "name": "marketing_connector_interest_c", "comment": null}, "recent_marketing_campaign_status_c": {"type": "integer", "index": 327, "name": "recent_marketing_campaign_status_c", "comment": null}, "salesloft_cadence_trigger_c": {"type": "integer", "index": 328, "name": "salesloft_cadence_trigger_c", "comment": null}, "datawarehouse_used_c": {"type": "integer", "index": 329, "name": "datawarehouse_used_c", "comment": null}, "contact_status_c": {"type": "integer", "index": 330, "name": "contact_status_c", "comment": null}, "leandata_contact_owner_override_c": {"type": "integer", "index": 331, "name": "leandata_contact_owner_override_c", "comment": null}, "potential_fivetran_use_case_c": {"type": "text", "index": 332, "name": "potential_fivetran_use_case_c", "comment": null}, "bizible_2_account_c": {"type": "integer", "index": 333, "name": "bizible_2_account_c", "comment": null}, "bizible_2_ad_campaign_name_ft_c": {"type": "integer", "index": 334, "name": "bizible_2_ad_campaign_name_ft_c", "comment": null}, "bizible_2_ad_campaign_name_lc_c": {"type": "integer", "index": 335, "name": "bizible_2_ad_campaign_name_lc_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 336, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_landing_page_ft_c": {"type": "integer", "index": 337, "name": "bizible_2_landing_page_ft_c", "comment": null}, "bizible_2_landing_page_lc_c": {"type": "integer", "index": 338, "name": "bizible_2_landing_page_lc_c", "comment": null}, "bizible_2_marketing_channel_ft_c": {"type": "integer", "index": 339, "name": "bizible_2_marketing_channel_ft_c", "comment": null}, "bizible_2_marketing_channel_lc_c": {"type": "integer", "index": 340, "name": "bizible_2_marketing_channel_lc_c", "comment": null}, "bizible_2_touchpoint_date_ft_c": {"type": "integer", "index": 341, "name": "bizible_2_touchpoint_date_ft_c", "comment": null}, "bizible_2_touchpoint_date_lc_c": {"type": "integer", "index": 342, "name": "bizible_2_touchpoint_date_lc_c", "comment": null}, "bizible_2_touchpoint_source_ft_c": {"type": "integer", "index": 343, "name": "bizible_2_touchpoint_source_ft_c", "comment": null}, "bizible_2_touchpoint_source_lc_c": {"type": "integer", "index": 344, "name": "bizible_2_touchpoint_source_lc_c", "comment": null}, "sales_email_opt_out_c": {"type": "boolean", "index": 345, "name": "sales_email_opt_out_c", "comment": null}, "sales_email_opt_out_date_time_c": {"type": "integer", "index": 346, "name": "sales_email_opt_out_date_time_c", "comment": null}, "bombora_app_bombora_surge_record_count_c": {"type": "integer", "index": 347, "name": "bombora_app_bombora_surge_record_count_c", "comment": null}, "bombora_app_bombora_last_date_time_updated_c": {"type": "integer", "index": 348, "name": "bombora_app_bombora_last_date_time_updated_c", "comment": null}, "bombora_app_bombora_total_composite_score_c": {"type": "integer", "index": 349, "name": "bombora_app_bombora_total_composite_score_c", "comment": null}, "linked_in_url_c": {"type": "integer", "index": 350, "name": "linked_in_url_c", "comment": null}, "beta_connector_interest_c": {"type": "integer", "index": 351, "name": "beta_connector_interest_c", "comment": null}, "user_gems_ug_past_infos_c": {"type": "integer", "index": 352, "name": "user_gems_ug_past_infos_c", "comment": null}, "user_gems_ug_current_infos_c": {"type": "integer", "index": 353, "name": "user_gems_ug_current_infos_c", "comment": null}, "user_gems_ug_created_by_ug_c": {"type": "boolean", "index": 354, "name": "user_gems_ug_created_by_ug_c", "comment": null}, "free_trial_email_confirmed_date_c": {"type": "integer", "index": 355, "name": "free_trial_email_confirmed_date_c", "comment": null}, "dnboptimizer_dn_bcontact_record_c": {"type": "integer", "index": 356, "name": "dnboptimizer_dn_bcontact_record_c", "comment": null}, "dnboptimizer_dn_bcompany_record_c": {"type": "integer", "index": 357, "name": "dnboptimizer_dn_bcompany_record_c", "comment": null}, "dnboptimizer_dnb_d_u_n_s_number_c": {"type": "integer", "index": 358, "name": "dnboptimizer_dnb_d_u_n_s_number_c", "comment": null}, "i_sell_oskey_id_c": {"type": "integer", "index": 359, "name": "i_sell_oskey_id_c", "comment": null}, "verified_c": {"type": "boolean", "index": 360, "name": "verified_c", "comment": null}, "email_opt_out_date_time_c": {"type": "integer", "index": 361, "name": "email_opt_out_date_time_c", "comment": null}, "pbf_startup_c": {"type": "integer", "index": 362, "name": "pbf_startup_c", "comment": null}, "pbf_startup_certify_eligibility_c": {"type": "boolean", "index": 363, "name": "pbf_startup_certify_eligibility_c", "comment": null}, "engagio_intent_minutes_last_30_days_c": {"type": "integer", "index": 364, "name": "engagio_intent_minutes_last_30_days_c", "comment": null}, "engagio_engagement_minutes_last_3_months_c": {"type": "integer", "index": 365, "name": "engagio_engagement_minutes_last_3_months_c", "comment": null}, "engagio_engagement_minutes_last_7_days_c": {"type": "integer", "index": 366, "name": "engagio_engagement_minutes_last_7_days_c", "comment": null}, "engagio_matched_account_c": {"type": "integer", "index": 367, "name": "engagio_matched_account_c", "comment": null}, "engagio_first_engagement_date_c": {"type": "integer", "index": 368, "name": "engagio_first_engagement_date_c", "comment": null}, "engagio_match_time_c": {"type": "integer", "index": 369, "name": "engagio_match_time_c", "comment": null}, "engagio_department_c": {"type": "integer", "index": 370, "name": "engagio_department_c", "comment": null}, "engagio_role_c": {"type": "integer", "index": 371, "name": "engagio_role_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 372, "name": "legacy_hvr_id_c", "comment": null}, "hvr_channel_c": {"type": "integer", "index": 373, "name": "hvr_channel_c", "comment": null}, "email_opt_in_double_c": {"type": "boolean", "index": 374, "name": "email_opt_in_double_c", "comment": null}, "phone_number_catch_all_c": {"type": "integer", "index": 375, "name": "phone_number_catch_all_c", "comment": null}, "contacts_domain_exists_c": {"type": "integer", "index": 376, "name": "contacts_domain_exists_c", "comment": null}, "utm_id_c": {"type": "integer", "index": 377, "name": "utm_id_c", "comment": null}, "source_every_utm_id_c": {"type": "integer", "index": 378, "name": "source_every_utm_id_c", "comment": null}, "source_last_utm_id_c": {"type": "integer", "index": 379, "name": "source_last_utm_id_c", "comment": null}, "source_first_utm_id_c": {"type": "integer", "index": 380, "name": "source_first_utm_id_c", "comment": null}, "do_not_sync_reason_marketo_c": {"type": "integer", "index": 381, "name": "do_not_sync_reason_marketo_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 382, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.lead"}, "source.salesforce_source.salesforce.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 3, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 4, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 7, "name": "description", "comment": null}, "expected_revenue": {"type": "integer", "index": 8, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": null}, "is_excluded_from_territory_2_filter": {"type": "integer", "index": 20, "name": "is_excluded_from_territory_2_filter", "comment": null}, "is_won": {"type": "boolean", "index": 21, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 22, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 23, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 24, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 25, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 27, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 29, "name": "pricebook_2_id", "comment": null}, "probability": {"type": "double precision", "index": 30, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 32, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 33, "name": "synced_quote_id", "comment": null}, "territory_2_id": {"type": "integer", "index": 34, "name": "territory_2_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 36, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.opportunity"}, "source.salesforce_source.salesforce_history.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_active": {"type": "boolean", "index": 1, "name": "_fivetran_active", "comment": null}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": null}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 5, "name": "account_id", "comment": null}, "amount": {"type": "double precision", "index": 6, "name": "amount", "comment": null}, "campaign_id": {"type": "integer", "index": 7, "name": "campaign_id", "comment": null}, "close_date": {"type": "timestamp without time zone", "index": 8, "name": "close_date", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 9, "name": "created_date", "comment": null}, "description": {"type": "integer", "index": 10, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 11, "name": "expected_revenue", "comment": null}, "fiscal": {"type": "text", "index": 12, "name": "fiscal", "comment": null}, "fiscal_quarter": {"type": "integer", "index": 13, "name": "fiscal_quarter", "comment": null}, "fiscal_year": {"type": "integer", "index": 14, "name": "fiscal_year", "comment": null}, "forecast_category": {"type": "text", "index": 15, "name": "forecast_category", "comment": null}, "forecast_category_name": {"type": "text", "index": 16, "name": "forecast_category_name", "comment": null}, "has_open_activity": {"type": "boolean", "index": 17, "name": "has_open_activity", "comment": null}, "has_opportunity_line_item": {"type": "boolean", "index": 18, "name": "has_opportunity_line_item", "comment": null}, "has_overdue_task": {"type": "boolean", "index": 19, "name": "has_overdue_task", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "is_closed": {"type": "boolean", "index": 21, "name": "is_closed", "comment": null}, "is_deleted": {"type": "boolean", "index": 22, "name": "is_deleted", "comment": null}, "is_won": {"type": "boolean", "index": 23, "name": "is_won", "comment": null}, "last_activity_date": {"type": "timestamp without time zone", "index": 24, "name": "last_activity_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 25, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 26, "name": "last_viewed_date", "comment": null}, "lead_source": {"type": "text", "index": 27, "name": "lead_source", "comment": null}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 29, "name": "next_step", "comment": null}, "owner_id": {"type": "text", "index": 30, "name": "owner_id", "comment": null}, "probability": {"type": "integer", "index": 31, "name": "probability", "comment": null}, "record_type_id": {"type": "text", "index": 32, "name": "record_type_id", "comment": null}, "stage_name": {"type": "text", "index": 33, "name": "stage_name", "comment": null}, "synced_quote_id": {"type": "integer", "index": 34, "name": "synced_quote_id", "comment": null}, "type": {"type": "text", "index": 35, "name": "type", "comment": null}}, "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.salesforce_source.salesforce_history.opportunity"}, "source.salesforce_source.salesforce.opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"product_2_id": {"type": "text", "index": 1, "name": "product_2_id", "comment": null}, "quantity": {"type": "integer", "index": 2, "name": "quantity", "comment": null}, "total_price": {"type": "double precision", "index": 3, "name": "total_price", "comment": null}, "description": {"type": "integer", "index": 4, "name": "description", "comment": null}, "discount": {"type": "integer", "index": 5, "name": "discount", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 6, "name": "last_modified_date", "comment": null}, "list_price": {"type": "integer", "index": 7, "name": "list_price", "comment": null}, "product_code": {"type": "text", "index": 8, "name": "product_code", "comment": null}, "unit_price": {"type": "double precision", "index": 9, "name": "unit_price", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": null}, "opportunity_id": {"type": "text", "index": 12, "name": "opportunity_id", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "service_date": {"type": "timestamp without time zone", "index": 14, "name": "service_date", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 15, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 16, "name": "name", "comment": null}, "id": {"type": "text", "index": 17, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "sort_order": {"type": "integer", "index": 20, "name": "sort_order", "comment": null}, "pricebook_entry_id": {"type": "text", "index": 21, "name": "pricebook_entry_id", "comment": null}, "one_saas_app_included_c": {"type": "integer", "index": 22, "name": "one_saas_app_included_c", "comment": null}, "one_saas_app_quantity_invoiced_c": {"type": "integer", "index": 23, "name": "one_saas_app_quantity_invoiced_c", "comment": null}, "one_saas_app_quantity_not_invoiced_c": {"type": "integer", "index": 24, "name": "one_saas_app_quantity_not_invoiced_c", "comment": null}, "has_quantity_schedule": {"type": "integer", "index": 25, "name": "has_quantity_schedule", "comment": null}, "has_revenue_schedule": {"type": "integer", "index": 26, "name": "has_revenue_schedule", "comment": null}, "has_schedule": {"type": "integer", "index": 27, "name": "has_schedule", "comment": null}, "event_volume_c": {"type": "integer", "index": 28, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 29, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 30, "name": "row_volume_c", "comment": null}, "months_c": {"type": "integer", "index": 31, "name": "months_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 32, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_discount_item_c": {"type": "integer", "index": 33, "name": "netsuite_conn_discount_item_c", "comment": null}, "netsuite_conn_user_entered_sales_price_c": {"type": "integer", "index": 34, "name": "netsuite_conn_user_entered_sales_price_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 35, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_terms_c": {"type": "integer", "index": 36, "name": "netsuite_conn_terms_c", "comment": null}, "netsuite_conn_net_suite_item_key_id_c": {"type": "integer", "index": 37, "name": "netsuite_conn_net_suite_item_key_id_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 38, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_end_date_c": {"type": "integer", "index": 39, "name": "netsuite_conn_end_date_c", "comment": null}, "netsuite_conn_list_rate_c": {"type": "integer", "index": 40, "name": "netsuite_conn_list_rate_c", "comment": null}, "netsuite_conn_from_contract_item_id_c": {"type": "integer", "index": 41, "name": "netsuite_conn_from_contract_item_id_c", "comment": null}, "netsuite_conn_start_date_c": {"type": "integer", "index": 42, "name": "netsuite_conn_start_date_c", "comment": null}, "netsuite_conn_net_suite_item_id_import_c": {"type": "integer", "index": 43, "name": "netsuite_conn_net_suite_item_id_import_c", "comment": null}, "sbqq_parent_id_c": {"type": "text", "index": 44, "name": "sbqq_parent_id_c", "comment": null}, "sbqq_quote_line_c": {"type": "text", "index": 45, "name": "sbqq_quote_line_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 46, "name": "sbqq_subscription_type_c", "comment": null}, "product_family_c": {"type": "text", "index": 47, "name": "product_family_c", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 48, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 49, "name": "last_viewed_date", "comment": null}, "celigo_sfnsio_contract_item_id_c": {"type": "integer", "index": 50, "name": "celigo_sfnsio_contract_item_id_c", "comment": null}, "celigo_sfnsio_contract_term_c": {"type": "integer", "index": 51, "name": "celigo_sfnsio_contract_term_c", "comment": null}, "celigo_sfnsio_end_date_c": {"type": "integer", "index": 52, "name": "celigo_sfnsio_end_date_c", "comment": null}, "celigo_sfnsio_list_rate_c": {"type": "integer", "index": 53, "name": "celigo_sfnsio_list_rate_c", "comment": null}, "celigo_sfnsio_net_suite_line_id_c": {"type": "integer", "index": 54, "name": "celigo_sfnsio_net_suite_line_id_c", "comment": null}, "celigo_sfnsio_start_date_c": {"type": "integer", "index": 55, "name": "celigo_sfnsio_start_date_c", "comment": null}, "product_code_stamped_c": {"type": "integer", "index": 56, "name": "product_code_stamped_c", "comment": null}, "hvr_use_case_c": {"type": "boolean", "index": 57, "name": "hvr_use_case_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 58, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.opportunity_line_item"}, "source.salesforce_source.salesforce.order": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "text", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": null}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": null}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": null}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": null}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": null}, "billing_country_code": {"type": "integer", "index": 8, "name": "billing_country_code", "comment": null}, "billing_geocode_accuracy": {"type": "integer", "index": 9, "name": "billing_geocode_accuracy", "comment": null}, "billing_latitude": {"type": "integer", "index": 10, "name": "billing_latitude", "comment": null}, "billing_longitude": {"type": "integer", "index": 11, "name": "billing_longitude", "comment": null}, "billing_postal_code": {"type": "text", "index": 12, "name": "billing_postal_code", "comment": null}, "billing_state": {"type": "text", "index": 13, "name": "billing_state", "comment": null}, "billing_state_code": {"type": "integer", "index": 14, "name": "billing_state_code", "comment": null}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": null}, "company_authorized_by_id": {"type": "integer", "index": 16, "name": "company_authorized_by_id", "comment": null}, "contract_id": {"type": "integer", "index": 17, "name": "contract_id", "comment": null}, "created_by_id": {"type": "text", "index": 18, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 19, "name": "created_date", "comment": null}, "customer_authorized_by_id": {"type": "integer", "index": 20, "name": "customer_authorized_by_id", "comment": null}, "description": {"type": "integer", "index": 21, "name": "description", "comment": null}, "effective_date": {"type": "timestamp without time zone", "index": 22, "name": "effective_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 23, "name": "end_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": null}, "is_reduction_order": {"type": "boolean", "index": 25, "name": "is_reduction_order", "comment": null}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 28, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 29, "name": "last_viewed_date", "comment": null}, "order_number": {"type": "integer", "index": 30, "name": "order_number", "comment": null}, "original_order_id": {"type": "integer", "index": 31, "name": "original_order_id", "comment": null}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": null}, "pricebook_2_id": {"type": "text", "index": 33, "name": "pricebook_2_id", "comment": null}, "shipping_city": {"type": "text", "index": 34, "name": "shipping_city", "comment": null}, "shipping_country": {"type": "text", "index": 35, "name": "shipping_country", "comment": null}, "shipping_country_code": {"type": "integer", "index": 36, "name": "shipping_country_code", "comment": null}, "shipping_geocode_accuracy": {"type": "integer", "index": 37, "name": "shipping_geocode_accuracy", "comment": null}, "shipping_latitude": {"type": "integer", "index": 38, "name": "shipping_latitude", "comment": null}, "shipping_longitude": {"type": "integer", "index": 39, "name": "shipping_longitude", "comment": null}, "shipping_postal_code": {"type": "integer", "index": 40, "name": "shipping_postal_code", "comment": null}, "shipping_state": {"type": "text", "index": 41, "name": "shipping_state", "comment": null}, "shipping_state_code": {"type": "integer", "index": 42, "name": "shipping_state_code", "comment": null}, "shipping_street": {"type": "text", "index": 43, "name": "shipping_street", "comment": null}, "status": {"type": "text", "index": 44, "name": "status", "comment": null}, "status_code": {"type": "text", "index": 45, "name": "status_code", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 46, "name": "system_modstamp", "comment": null}, "total_amount": {"type": "double precision", "index": 47, "name": "total_amount", "comment": null}, "type": {"type": "text", "index": 48, "name": "type", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 49, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "integer", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_pushed_from_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_pushed_from_net_suite_c", "comment": null}, "netsuite_conn_opportunity_c": {"type": "integer", "index": 53, "name": "netsuite_conn_opportunity_c", "comment": null}, "netsuite_conn_net_suite_order_status_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_order_status_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 55, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_tax_total_c": {"type": "integer", "index": 56, "name": "netsuite_conn_tax_total_c", "comment": null}, "netsuite_conn_tracking_numbers_c": {"type": "integer", "index": 57, "name": "netsuite_conn_tracking_numbers_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 58, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_document_id_c": {"type": "integer", "index": 59, "name": "netsuite_conn_document_id_c", "comment": null}, "netsuite_conn_subtotal_c": {"type": "integer", "index": 60, "name": "netsuite_conn_subtotal_c", "comment": null}, "netsuite_conn_discount_total_c": {"type": "integer", "index": 61, "name": "netsuite_conn_discount_total_c", "comment": null}, "netsuite_conn_total_c": {"type": "integer", "index": 62, "name": "netsuite_conn_total_c", "comment": null}, "netsuite_conn_net_suite_order_date_c": {"type": "timestamp without time zone", "index": 63, "name": "netsuite_conn_net_suite_order_date_c", "comment": null}, "netsuite_conn_ship_date_c": {"type": "integer", "index": 64, "name": "netsuite_conn_ship_date_c", "comment": null}, "netsuite_conn_quote_c": {"type": "integer", "index": 65, "name": "netsuite_conn_quote_c", "comment": null}, "netsuite_conn_net_suite_order_number_c": {"type": "text", "index": 66, "name": "netsuite_conn_net_suite_order_number_c", "comment": null}, "sbqq_contracted_c": {"type": "boolean", "index": 67, "name": "sbqq_contracted_c", "comment": null}, "sbqq_contracting_method_c": {"type": "text", "index": 68, "name": "sbqq_contracting_method_c", "comment": null}, "sbqq_payment_term_c": {"type": "text", "index": 69, "name": "sbqq_payment_term_c", "comment": null}, "sbqq_price_calc_status_c": {"type": "text", "index": 70, "name": "sbqq_price_calc_status_c", "comment": null}, "sbqq_price_calc_status_message_c": {"type": "integer", "index": 71, "name": "sbqq_price_calc_status_message_c", "comment": null}, "sbqq_quote_c": {"type": "text", "index": 72, "name": "sbqq_quote_c", "comment": null}, "sbqq_renewal_term_c": {"type": "integer", "index": 73, "name": "sbqq_renewal_term_c", "comment": null}, "sbqq_renewal_uplift_rate_c": {"type": "integer", "index": 74, "name": "sbqq_renewal_uplift_rate_c", "comment": null}, "ava_sfcpq_ava_tax_message_c": {"type": "text", "index": 75, "name": "ava_sfcpq_ava_tax_message_c", "comment": null}, "ava_sfcpq_entity_use_code_c": {"type": "integer", "index": 76, "name": "ava_sfcpq_entity_use_code_c", "comment": null}, "ava_sfcpq_invoice_message_c": {"type": "integer", "index": 77, "name": "ava_sfcpq_invoice_message_c", "comment": null}, "ava_sfcpq_is_seller_importer_of_record_c": {"type": "boolean", "index": 78, "name": "ava_sfcpq_is_seller_importer_of_record_c", "comment": null}, "ava_sfcpq_order_calculate_tax_c": {"type": "boolean", "index": 79, "name": "ava_sfcpq_order_calculate_tax_c", "comment": null}, "ava_sfcpq_sales_tax_amount_c": {"type": "integer", "index": 80, "name": "ava_sfcpq_sales_tax_amount_c", "comment": null}, "blng_bill_now_c": {"type": "boolean", "index": 81, "name": "blng_bill_now_c", "comment": null}, "blng_billing_account_c": {"type": "text", "index": 82, "name": "blng_billing_account_c", "comment": null}, "blng_billing_day_of_month_c": {"type": "integer", "index": 83, "name": "blng_billing_day_of_month_c", "comment": null}, "blng_invoice_batch_c": {"type": "text", "index": 84, "name": "blng_invoice_batch_c", "comment": null}, "amendment_type_c": {"type": "integer", "index": 85, "name": "amendment_type_c", "comment": null}, "credit_summary_c": {"type": "text", "index": 86, "name": "credit_summary_c", "comment": null}, "evergreen_c": {"type": "boolean", "index": 87, "name": "evergreen_c", "comment": null}, "invoicing_type_c": {"type": "text", "index": 88, "name": "invoicing_type_c", "comment": null}, "legal_entity_c": {"type": "text", "index": 89, "name": "legal_entity_c", "comment": null}, "prepaid_billing_frequency_c": {"type": "text", "index": 90, "name": "prepaid_billing_frequency_c", "comment": null}, "prepaid_order_c": {"type": "boolean", "index": 91, "name": "prepaid_order_c", "comment": null}, "update_subscriptions_only_c": {"type": "boolean", "index": 92, "name": "update_subscriptions_only_c", "comment": null}, "order_auto_activated_c": {"type": "boolean", "index": 93, "name": "order_auto_activated_c", "comment": null}, "synced_to_net_suite_c": {"type": "boolean", "index": 94, "name": "synced_to_net_suite_c", "comment": null}, "purchase_order_number_c": {"type": "integer", "index": 95, "name": "purchase_order_number_c", "comment": null}, "celigo_sfnsio_discount_total_net_suite_c": {"type": "integer", "index": 96, "name": "celigo_sfnsio_discount_total_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 97, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "celigo_sfnsio_net_suite_order_number_c": {"type": "text", "index": 98, "name": "celigo_sfnsio_net_suite_order_number_c", "comment": null}, "celigo_sfnsio_net_suite_order_status_c": {"type": "integer", "index": 99, "name": "celigo_sfnsio_net_suite_order_status_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "text", "index": 100, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_ship_date_c": {"type": "integer", "index": 101, "name": "celigo_sfnsio_ship_date_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 102, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_sub_total_net_suite_c": {"type": "integer", "index": 103, "name": "celigo_sfnsio_sub_total_net_suite_c", "comment": null}, "celigo_sfnsio_tax_total_net_suite_c": {"type": "integer", "index": 104, "name": "celigo_sfnsio_tax_total_net_suite_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 105, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_total_net_suite_c": {"type": "integer", "index": 106, "name": "celigo_sfnsio_total_net_suite_c", "comment": null}, "amend_with_rollover_spend_type_c": {"type": "boolean", "index": 107, "name": "amend_with_rollover_spend_type_c", "comment": null}, "customer_spend_type_c": {"type": "integer", "index": 108, "name": "customer_spend_type_c", "comment": null}, "order_spend_type_c": {"type": "integer", "index": 109, "name": "order_spend_type_c", "comment": null}, "opportunity_id": {"type": "integer", "index": 110, "name": "opportunity_id", "comment": null}, "purchase_summary_c": {"type": "integer", "index": 111, "name": "purchase_summary_c", "comment": null}, "is_hvr_legacy_order_c": {"type": "integer", "index": 112, "name": "is_hvr_legacy_order_c", "comment": null}, "ironclad_workflow_c": {"type": "integer", "index": 113, "name": "ironclad_workflow_c", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 114, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.order"}, "source.salesforce_source.salesforce.product_2": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"last_referenced_date": {"type": "timestamp without time zone", "index": 1, "name": "last_referenced_date", "comment": null}, "is_active": {"type": "boolean", "index": 2, "name": "is_active", "comment": null}, "description": {"type": "integer", "index": 3, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 4, "name": "last_modified_date", "comment": null}, "record_type_id": {"type": "text", "index": 5, "name": "record_type_id", "comment": null}, "product_code": {"type": "integer", "index": 6, "name": "product_code", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 8, "name": "last_viewed_date", "comment": null}, "is_deleted": {"type": "boolean", "index": 9, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 10, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 11, "name": "system_modstamp", "comment": null}, "name": {"type": "text", "index": 12, "name": "name", "comment": null}, "id": {"type": "text", "index": 13, "name": "id", "comment": null}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": null}, "family": {"type": "text", "index": 16, "name": "family", "comment": null}, "max_volume_c": {"type": "integer", "index": 17, "name": "max_volume_c", "comment": null}, "min_volume_c": {"type": "integer", "index": 18, "name": "min_volume_c", "comment": null}, "request_name_c": {"type": "integer", "index": 19, "name": "request_name_c", "comment": null}, "default_quantity_c": {"type": "integer", "index": 20, "name": "default_quantity_c", "comment": null}, "account_c": {"type": "integer", "index": 21, "name": "account_c", "comment": null}, "related_product_c": {"type": "integer", "index": 22, "name": "related_product_c", "comment": null}, "picklist_value_c": {"type": "integer", "index": 23, "name": "picklist_value_c", "comment": null}, "as_input_c": {"type": "integer", "index": 24, "name": "as_input_c", "comment": null}, "as_output_c": {"type": "integer", "index": 25, "name": "as_output_c", "comment": null}, "status_c": {"type": "integer", "index": 26, "name": "status_c", "comment": null}, "number_of_quantity_installments": {"type": "integer", "index": 27, "name": "number_of_quantity_installments", "comment": null}, "number_of_revenue_installments": {"type": "integer", "index": 28, "name": "number_of_revenue_installments", "comment": null}, "quantity_installment_period": {"type": "integer", "index": 29, "name": "quantity_installment_period", "comment": null}, "quantity_schedule_type": {"type": "integer", "index": 30, "name": "quantity_schedule_type", "comment": null}, "revenue_installment_period": {"type": "integer", "index": 31, "name": "revenue_installment_period", "comment": null}, "revenue_schedule_type": {"type": "integer", "index": 32, "name": "revenue_schedule_type", "comment": null}, "connections_c": {"type": "integer", "index": 33, "name": "connections_c", "comment": null}, "event_volume_c": {"type": "integer", "index": 34, "name": "event_volume_c", "comment": null}, "roadmap_connections_c": {"type": "integer", "index": 35, "name": "roadmap_connections_c", "comment": null}, "row_volume_c": {"type": "integer", "index": 36, "name": "row_volume_c", "comment": null}, "display_url": {"type": "integer", "index": 37, "name": "display_url", "comment": null}, "external_data_source_id": {"type": "integer", "index": 38, "name": "external_data_source_id", "comment": null}, "external_id": {"type": "integer", "index": 39, "name": "external_id", "comment": null}, "quantity_unit_of_measure": {"type": "integer", "index": 40, "name": "quantity_unit_of_measure", "comment": null}, "stock_keeping_unit": {"type": "integer", "index": 41, "name": "stock_keeping_unit", "comment": null}, "features_c": {"type": "integer", "index": 42, "name": "features_c", "comment": null}, "tier_3_price_c": {"type": "integer", "index": 43, "name": "tier_3_price_c", "comment": null}, "tier_2_price_c": {"type": "integer", "index": 44, "name": "tier_2_price_c", "comment": null}, "tier_4_price_c": {"type": "integer", "index": 45, "name": "tier_4_price_c", "comment": null}, "tier_1_price_c": {"type": "integer", "index": 46, "name": "tier_1_price_c", "comment": null}, "netsuite_conn_sync_in_progress_c": {"type": "boolean", "index": 47, "name": "netsuite_conn_sync_in_progress_c", "comment": null}, "netsuite_conn_celigo_update_c": {"type": "boolean", "index": 48, "name": "netsuite_conn_celigo_update_c", "comment": null}, "netsuite_conn_term_contract_pricing_type_c": {"type": "integer", "index": 49, "name": "netsuite_conn_term_contract_pricing_type_c", "comment": null}, "netsuite_conn_net_suite_id_c": {"type": "integer", "index": 50, "name": "netsuite_conn_net_suite_id_c", "comment": null}, "netsuite_conn_net_suite_sync_err_c": {"type": "text", "index": 51, "name": "netsuite_conn_net_suite_sync_err_c", "comment": null}, "netsuite_conn_push_to_net_suite_c": {"type": "boolean", "index": 52, "name": "netsuite_conn_push_to_net_suite_c", "comment": null}, "netsuite_conn_item_category_c": {"type": "integer", "index": 53, "name": "netsuite_conn_item_category_c", "comment": null}, "netsuite_conn_net_suite_item_type_c": {"type": "text", "index": 54, "name": "netsuite_conn_net_suite_item_type_c", "comment": null}, "netsuite_conn_sub_type_c": {"type": "text", "index": 55, "name": "netsuite_conn_sub_type_c", "comment": null}, "is_new_c": {"type": "boolean", "index": 56, "name": "is_new_c", "comment": null}, "product_metadata_c": {"type": "integer", "index": 57, "name": "product_metadata_c", "comment": null}, "product_metadata_del_c": {"type": "integer", "index": 58, "name": "product_metadata_del_c", "comment": null}, "sbqq_asset_amendment_behavior_c": {"type": "text", "index": 59, "name": "sbqq_asset_amendment_behavior_c", "comment": null}, "sbqq_asset_conversion_c": {"type": "text", "index": 60, "name": "sbqq_asset_conversion_c", "comment": null}, "sbqq_batch_quantity_c": {"type": "integer", "index": 61, "name": "sbqq_batch_quantity_c", "comment": null}, "sbqq_billing_frequency_c": {"type": "text", "index": 62, "name": "sbqq_billing_frequency_c", "comment": null}, "sbqq_billing_type_c": {"type": "text", "index": 63, "name": "sbqq_billing_type_c", "comment": null}, "sbqq_block_pricing_field_c": {"type": "text", "index": 64, "name": "sbqq_block_pricing_field_c", "comment": null}, "sbqq_charge_type_c": {"type": "text", "index": 65, "name": "sbqq_charge_type_c", "comment": null}, "sbqq_component_c": {"type": "boolean", "index": 66, "name": "sbqq_component_c", "comment": null}, "sbqq_compound_discount_rate_c": {"type": "integer", "index": 67, "name": "sbqq_compound_discount_rate_c", "comment": null}, "sbqq_configuration_event_c": {"type": "integer", "index": 68, "name": "sbqq_configuration_event_c", "comment": null}, "sbqq_configuration_field_set_c": {"type": "integer", "index": 69, "name": "sbqq_configuration_field_set_c", "comment": null}, "sbqq_configuration_fields_c": {"type": "integer", "index": 70, "name": "sbqq_configuration_fields_c", "comment": null}, "sbqq_configuration_form_title_c": {"type": "integer", "index": 71, "name": "sbqq_configuration_form_title_c", "comment": null}, "sbqq_configuration_type_c": {"type": "integer", "index": 72, "name": "sbqq_configuration_type_c", "comment": null}, "sbqq_configuration_validator_c": {"type": "integer", "index": 73, "name": "sbqq_configuration_validator_c", "comment": null}, "sbqq_configured_code_pattern_c": {"type": "integer", "index": 74, "name": "sbqq_configured_code_pattern_c", "comment": null}, "sbqq_configured_description_pattern_c": {"type": "integer", "index": 75, "name": "sbqq_configured_description_pattern_c", "comment": null}, "sbqq_cost_editable_c": {"type": "boolean", "index": 76, "name": "sbqq_cost_editable_c", "comment": null}, "sbqq_cost_schedule_c": {"type": "integer", "index": 77, "name": "sbqq_cost_schedule_c", "comment": null}, "sbqq_custom_configuration_page_c": {"type": "integer", "index": 78, "name": "sbqq_custom_configuration_page_c", "comment": null}, "sbqq_custom_configuration_required_c": {"type": "boolean", "index": 79, "name": "sbqq_custom_configuration_required_c", "comment": null}, "sbqq_customer_community_availability_c": {"type": "integer", "index": 80, "name": "sbqq_customer_community_availability_c", "comment": null}, "sbqq_default_pricing_table_c": {"type": "integer", "index": 81, "name": "sbqq_default_pricing_table_c", "comment": null}, "sbqq_default_quantity_c": {"type": "integer", "index": 82, "name": "sbqq_default_quantity_c", "comment": null}, "sbqq_description_locked_c": {"type": "boolean", "index": 83, "name": "sbqq_description_locked_c", "comment": null}, "sbqq_discount_category_c": {"type": "integer", "index": 84, "name": "sbqq_discount_category_c", "comment": null}, "sbqq_discount_schedule_c": {"type": "integer", "index": 85, "name": "sbqq_discount_schedule_c", "comment": null}, "sbqq_dynamic_pricing_constraint_c": {"type": "integer", "index": 86, "name": "sbqq_dynamic_pricing_constraint_c", "comment": null}, "sbqq_exclude_from_maintenance_c": {"type": "boolean", "index": 87, "name": "sbqq_exclude_from_maintenance_c", "comment": null}, "sbqq_exclude_from_opportunity_c": {"type": "boolean", "index": 88, "name": "sbqq_exclude_from_opportunity_c", "comment": null}, "sbqq_externally_configurable_c": {"type": "boolean", "index": 89, "name": "sbqq_externally_configurable_c", "comment": null}, "sbqq_generate_contracted_price_c": {"type": "integer", "index": 90, "name": "sbqq_generate_contracted_price_c", "comment": null}, "sbqq_has_configuration_attributes_c": {"type": "boolean", "index": 91, "name": "sbqq_has_configuration_attributes_c", "comment": null}, "sbqq_has_consumption_schedule_c": {"type": "boolean", "index": 92, "name": "sbqq_has_consumption_schedule_c", "comment": null}, "sbqq_hidden_c": {"type": "boolean", "index": 93, "name": "sbqq_hidden_c", "comment": null}, "sbqq_hide_price_in_search_results_c": {"type": "boolean", "index": 94, "name": "sbqq_hide_price_in_search_results_c", "comment": null}, "sbqq_include_in_maintenance_c": {"type": "boolean", "index": 95, "name": "sbqq_include_in_maintenance_c", "comment": null}, "sbqq_new_quote_group_c": {"type": "boolean", "index": 96, "name": "sbqq_new_quote_group_c", "comment": null}, "sbqq_non_discountable_c": {"type": "boolean", "index": 97, "name": "sbqq_non_discountable_c", "comment": null}, "sbqq_non_partner_discountable_c": {"type": "boolean", "index": 98, "name": "sbqq_non_partner_discountable_c", "comment": null}, "sbqq_option_layout_c": {"type": "integer", "index": 99, "name": "sbqq_option_layout_c", "comment": null}, "sbqq_option_selection_method_c": {"type": "text", "index": 100, "name": "sbqq_option_selection_method_c", "comment": null}, "sbqq_optional_c": {"type": "boolean", "index": 101, "name": "sbqq_optional_c", "comment": null}, "sbqq_price_editable_c": {"type": "boolean", "index": 102, "name": "sbqq_price_editable_c", "comment": null}, "sbqq_pricing_method_c": {"type": "text", "index": 103, "name": "sbqq_pricing_method_c", "comment": null}, "sbqq_pricing_method_editable_c": {"type": "boolean", "index": 104, "name": "sbqq_pricing_method_editable_c", "comment": null}, "sbqq_product_picture_id_c": {"type": "integer", "index": 105, "name": "sbqq_product_picture_id_c", "comment": null}, "sbqq_quantity_editable_c": {"type": "boolean", "index": 106, "name": "sbqq_quantity_editable_c", "comment": null}, "sbqq_quantity_scale_c": {"type": "integer", "index": 107, "name": "sbqq_quantity_scale_c", "comment": null}, "sbqq_reconfiguration_disabled_c": {"type": "boolean", "index": 108, "name": "sbqq_reconfiguration_disabled_c", "comment": null}, "sbqq_renewal_product_c": {"type": "integer", "index": 109, "name": "sbqq_renewal_product_c", "comment": null}, "sbqq_sort_order_c": {"type": "integer", "index": 110, "name": "sbqq_sort_order_c", "comment": null}, "sbqq_specifications_c": {"type": "integer", "index": 111, "name": "sbqq_specifications_c", "comment": null}, "sbqq_subscription_base_c": {"type": "text", "index": 112, "name": "sbqq_subscription_base_c", "comment": null}, "sbqq_subscription_category_c": {"type": "integer", "index": 113, "name": "sbqq_subscription_category_c", "comment": null}, "sbqq_subscription_percent_c": {"type": "integer", "index": 114, "name": "sbqq_subscription_percent_c", "comment": null}, "sbqq_subscription_pricing_c": {"type": "text", "index": 115, "name": "sbqq_subscription_pricing_c", "comment": null}, "sbqq_subscription_target_c": {"type": "integer", "index": 116, "name": "sbqq_subscription_target_c", "comment": null}, "sbqq_subscription_term_c": {"type": "integer", "index": 117, "name": "sbqq_subscription_term_c", "comment": null}, "sbqq_subscription_type_c": {"type": "text", "index": 118, "name": "sbqq_subscription_type_c", "comment": null}, "sbqq_tax_code_c": {"type": "integer", "index": 119, "name": "sbqq_tax_code_c", "comment": null}, "sbqq_taxable_c": {"type": "boolean", "index": 120, "name": "sbqq_taxable_c", "comment": null}, "sbqq_term_discount_level_c": {"type": "integer", "index": 121, "name": "sbqq_term_discount_level_c", "comment": null}, "sbqq_term_discount_schedule_c": {"type": "integer", "index": 122, "name": "sbqq_term_discount_schedule_c", "comment": null}, "sbqq_upgrade_credit_c": {"type": "integer", "index": 123, "name": "sbqq_upgrade_credit_c", "comment": null}, "sbqq_upgrade_ratio_c": {"type": "integer", "index": 124, "name": "sbqq_upgrade_ratio_c", "comment": null}, "sbqq_upgrade_source_c": {"type": "integer", "index": 125, "name": "sbqq_upgrade_source_c", "comment": null}, "sbqq_upgrade_target_c": {"type": "integer", "index": 126, "name": "sbqq_upgrade_target_c", "comment": null}, "connector_type_c": {"type": "text", "index": 127, "name": "connector_type_c", "comment": null}, "pbf_pro_type_discount_c": {"type": "boolean", "index": 128, "name": "pbf_pro_type_discount_c", "comment": null}, "dimension_c": {"type": "text", "index": 129, "name": "dimension_c", "comment": null}, "connector_status_c": {"type": "text", "index": 130, "name": "connector_status_c", "comment": null}, "dimension_definition_c": {"type": "integer", "index": 131, "name": "dimension_definition_c", "comment": null}, "ava_sfcpq_tax_code_c": {"type": "integer", "index": 132, "name": "ava_sfcpq_tax_code_c", "comment": null}, "paid_consumption_c": {"type": "integer", "index": 133, "name": "paid_consumption_c", "comment": null}, "is_complimentary_c": {"type": "boolean", "index": 134, "name": "is_complimentary_c", "comment": null}, "product_external_id_c": {"type": "integer", "index": 135, "name": "product_external_id_c", "comment": null}, "blng_billing_rule_c": {"type": "text", "index": 136, "name": "blng_billing_rule_c", "comment": null}, "blng_revenue_recognition_rule_c": {"type": "text", "index": 137, "name": "blng_revenue_recognition_rule_c", "comment": null}, "blng_tax_rule_c": {"type": "text", "index": 138, "name": "blng_tax_rule_c", "comment": null}, "deployment_date_c": {"type": "integer", "index": 139, "name": "deployment_date_c", "comment": null}, "do_not_prorate_c": {"type": "boolean", "index": 140, "name": "do_not_prorate_c", "comment": null}, "celigo_sfnsio_netsuite_id_c": {"type": "integer", "index": 141, "name": "celigo_sfnsio_netsuite_id_c", "comment": null}, "sbqq_enable_large_configuration_c": {"type": "boolean", "index": 142, "name": "sbqq_enable_large_configuration_c", "comment": null}, "sbqq_pricing_guidance_c": {"type": "integer", "index": 143, "name": "sbqq_pricing_guidance_c", "comment": null}, "celigo_sfnsio_item_pricing_type_c": {"type": "integer", "index": 144, "name": "celigo_sfnsio_item_pricing_type_c", "comment": null}, "celigo_sfnsio_test_mode_record_c": {"type": "boolean", "index": 145, "name": "celigo_sfnsio_test_mode_record_c", "comment": null}, "celigo_sfnsio_celigo_last_modified_date_c": {"type": "timestamp without time zone", "index": 146, "name": "celigo_sfnsio_celigo_last_modified_date_c", "comment": null}, "celigo_sfnsio_net_suite_record_c": {"type": "integer", "index": 147, "name": "celigo_sfnsio_net_suite_record_c", "comment": null}, "celigo_sfnsio_skip_export_to_net_suite_c": {"type": "boolean", "index": 148, "name": "celigo_sfnsio_skip_export_to_net_suite_c", "comment": null}, "celigo_sfnsio_net_suite_item_type_c": {"type": "integer", "index": 149, "name": "celigo_sfnsio_net_suite_item_type_c", "comment": null}, "celigo_sfnsio_net_suite_id_c": {"type": "integer", "index": 150, "name": "celigo_sfnsio_net_suite_id_c", "comment": null}, "promo_code_c": {"type": "integer", "index": 151, "name": "promo_code_c", "comment": null}, "product_category_c": {"type": "integer", "index": 152, "name": "product_category_c", "comment": null}, "product_source_c": {"type": "integer", "index": 153, "name": "product_source_c", "comment": null}, "non_recurring_c": {"type": "boolean", "index": 154, "name": "non_recurring_c", "comment": null}, "is_archived": {"type": "boolean", "index": 155, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 156, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.product_2"}, "source.salesforce_source.salesforce.task": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"referral_account_c": {"type": "integer", "index": 1, "name": "referral_account_c", "comment": null}, "who_id": {"type": "text", "index": 2, "name": "who_id", "comment": null}, "call_disposition": {"type": "integer", "index": 3, "name": "call_disposition", "comment": null}, "recurrence_day_of_month": {"type": "integer", "index": 4, "name": "recurrence_day_of_month", "comment": null}, "owner_id": {"type": "text", "index": 5, "name": "owner_id", "comment": null}, "recurrence_end_date_only": {"type": "timestamp without time zone", "index": 6, "name": "recurrence_end_date_only", "comment": null}, "subject": {"type": "text", "index": 7, "name": "subject", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "last_modified_date": {"type": "timestamp without time zone", "index": 9, "name": "last_modified_date", "comment": null}, "recurrence_time_zone_sid_key": {"type": "integer", "index": 10, "name": "recurrence_time_zone_sid_key", "comment": null}, "is_recurrence": {"type": "boolean", "index": 11, "name": "is_recurrence", "comment": null}, "what_count": {"type": "integer", "index": 12, "name": "what_count", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "call_object": {"type": "integer", "index": 14, "name": "call_object", "comment": null}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": null}, "recurrence_day_of_week_mask": {"type": "integer", "index": 16, "name": "recurrence_day_of_week_mask", "comment": null}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": null}, "system_modstamp": {"type": "timestamp without time zone", "index": 18, "name": "system_modstamp", "comment": null}, "recurrence_regenerated_type": {"type": "integer", "index": 19, "name": "recurrence_regenerated_type", "comment": null}, "id": {"type": "text", "index": 20, "name": "id", "comment": null}, "recurrence_type": {"type": "integer", "index": 21, "name": "recurrence_type", "comment": null}, "reminder_date_time": {"type": "timestamp without time zone", "index": 22, "name": "reminder_date_time", "comment": null}, "call_type": {"type": "integer", "index": 23, "name": "call_type", "comment": null}, "is_high_priority": {"type": "boolean", "index": 24, "name": "is_high_priority", "comment": null}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": null}, "recurrence_month_of_year": {"type": "integer", "index": 26, "name": "recurrence_month_of_year", "comment": null}, "is_reminder_set": {"type": "boolean", "index": 27, "name": "is_reminder_set", "comment": null}, "activity_date": {"type": "timestamp without time zone", "index": 28, "name": "activity_date", "comment": null}, "recurrence_instance": {"type": "integer", "index": 29, "name": "recurrence_instance", "comment": null}, "priority": {"type": "text", "index": 30, "name": "priority", "comment": null}, "recurrence_interval": {"type": "integer", "index": 31, "name": "recurrence_interval", "comment": null}, "who_count": {"type": "integer", "index": 32, "name": "who_count", "comment": null}, "recurrence_start_date_only": {"type": "timestamp without time zone", "index": 33, "name": "recurrence_start_date_only", "comment": null}, "account_id": {"type": "text", "index": 34, "name": "account_id", "comment": null}, "referral_contact_c": {"type": "integer", "index": 35, "name": "referral_contact_c", "comment": null}, "call_duration_in_seconds": {"type": "integer", "index": 36, "name": "call_duration_in_seconds", "comment": null}, "created_by_id": {"type": "text", "index": 37, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 38, "name": "created_date", "comment": null}, "recurrence_activity_id": {"type": "integer", "index": 39, "name": "recurrence_activity_id", "comment": null}, "what_id": {"type": "text", "index": 40, "name": "what_id", "comment": null}, "task_subtype": {"type": "text", "index": 41, "name": "task_subtype", "comment": null}, "status": {"type": "text", "index": 42, "name": "status", "comment": null}, "invitee_uuid_c": {"type": "integer", "index": 43, "name": "invitee_uuid_c", "comment": null}, "type": {"type": "text", "index": 44, "name": "type", "comment": null}, "no_show_c": {"type": "boolean", "index": 45, "name": "no_show_c", "comment": null}, "first_meeting_held_c": {"type": "integer", "index": 46, "name": "first_meeting_held_c", "comment": null}, "associated_sdr_c": {"type": "integer", "index": 47, "name": "associated_sdr_c", "comment": null}, "first_meeting_c": {"type": "integer", "index": 48, "name": "first_meeting_c", "comment": null}, "call_recording_c": {"type": "integer", "index": 49, "name": "call_recording_c", "comment": null}, "affectlayer_chorus_call_id_c": {"type": "integer", "index": 50, "name": "affectlayer_chorus_call_id_c", "comment": null}, "affectlayer_affect_layer_call_id_c": {"type": "integer", "index": 51, "name": "affectlayer_affect_layer_call_id_c", "comment": null}, "last_rep_activity_date_c": {"type": "integer", "index": 52, "name": "last_rep_activity_date_c", "comment": null}, "lid_url_c": {"type": "integer", "index": 53, "name": "lid_url_c", "comment": null}, "lid_date_sent_c": {"type": "integer", "index": 54, "name": "lid_date_sent_c", "comment": null}, "record_type_id": {"type": "text", "index": 55, "name": "record_type_id", "comment": null}, "sales_loft_step_id_c": {"type": "integer", "index": 56, "name": "sales_loft_step_id_c", "comment": null}, "sales_loft_step_name_c": {"type": "integer", "index": 57, "name": "sales_loft_step_name_c", "comment": null}, "sales_loft_step_type_c": {"type": "integer", "index": 58, "name": "sales_loft_step_type_c", "comment": null}, "sales_loft_email_template_id_c": {"type": "integer", "index": 59, "name": "sales_loft_email_template_id_c", "comment": null}, "sales_loft_external_identifier_c": {"type": "integer", "index": 60, "name": "sales_loft_external_identifier_c", "comment": null}, "sales_loft_cadence_id_c": {"type": "integer", "index": 61, "name": "sales_loft_cadence_id_c", "comment": null}, "sales_loft_clicked_count_c": {"type": "integer", "index": 62, "name": "sales_loft_clicked_count_c", "comment": null}, "sales_loft_cadence_name_c": {"type": "integer", "index": 63, "name": "sales_loft_cadence_name_c", "comment": null}, "sales_loft_reply_count_c": {"type": "integer", "index": 64, "name": "sales_loft_reply_count_c", "comment": null}, "call_disposition_c": {"type": "integer", "index": 65, "name": "call_disposition_c", "comment": null}, "sales_loft_email_template_title_c": {"type": "integer", "index": 66, "name": "sales_loft_email_template_title_c", "comment": null}, "sales_loft_step_day_new_c": {"type": "integer", "index": 67, "name": "sales_loft_step_day_new_c", "comment": null}, "call_disposition_2_c": {"type": "integer", "index": 68, "name": "call_disposition_2_c", "comment": null}, "sales_loft_viewed_count_c": {"type": "integer", "index": 69, "name": "sales_loft_viewed_count_c", "comment": null}, "sales_loft_1_sales_loft_step_day_c": {"type": "integer", "index": 70, "name": "sales_loft_1_sales_loft_step_day_c", "comment": null}, "sales_loft_1_sales_loft_clicked_count_c": {"type": "integer", "index": 71, "name": "sales_loft_1_sales_loft_clicked_count_c", "comment": null}, "sales_loft_1_sales_loft_view_count_c": {"type": "integer", "index": 72, "name": "sales_loft_1_sales_loft_view_count_c", "comment": null}, "sales_loft_1_call_disposition_c": {"type": "integer", "index": 73, "name": "sales_loft_1_call_disposition_c", "comment": null}, "sales_loft_1_sales_loft_replies_count_c": {"type": "integer", "index": 74, "name": "sales_loft_1_sales_loft_replies_count_c", "comment": null}, "sales_loft_1_sales_loft_cadence_name_c": {"type": "integer", "index": 75, "name": "sales_loft_1_sales_loft_cadence_name_c", "comment": null}, "sales_loft_1_call_sentiment_c": {"type": "integer", "index": 76, "name": "sales_loft_1_call_sentiment_c", "comment": null}, "sales_loft_1_sales_loft_email_template_title_c": {"type": "integer", "index": 77, "name": "sales_loft_1_sales_loft_email_template_title_c", "comment": null}, "completed_date_time": {"type": "timestamp without time zone", "index": 78, "name": "completed_date_time", "comment": null}, "is_a_co_sell_activity_c": {"type": "integer", "index": 79, "name": "is_a_co_sell_activity_c", "comment": null}, "partner_contact_c": {"type": "integer", "index": 80, "name": "partner_contact_c", "comment": null}, "co_selling_activity_c": {"type": "integer", "index": 81, "name": "co_selling_activity_c", "comment": null}, "description_c": {"type": "integer", "index": 82, "name": "description_c", "comment": null}, "co_sell_partner_account_c": {"type": "integer", "index": 83, "name": "co_sell_partner_account_c", "comment": null}, "campaign_c": {"type": "integer", "index": 84, "name": "campaign_c", "comment": null}, "partner_account_c": {"type": "integer", "index": 85, "name": "partner_account_c", "comment": null}, "topic_c": {"type": "integer", "index": 86, "name": "topic_c", "comment": null}, "event_name_c": {"type": "integer", "index": 87, "name": "event_name_c", "comment": null}, "attendance_number_c": {"type": "integer", "index": 88, "name": "attendance_number_c", "comment": null}, "partner_activity_type_c": {"type": "integer", "index": 89, "name": "partner_activity_type_c", "comment": null}, "proof_of_referral_c": {"type": "integer", "index": 90, "name": "proof_of_referral_c", "comment": null}, "how_did_you_bring_value_or_create_trust_c": {"type": "integer", "index": 91, "name": "how_did_you_bring_value_or_create_trust_c", "comment": null}, "how_did_you_bring_value_or_earn_trust_c": {"type": "integer", "index": 92, "name": "how_did_you_bring_value_or_earn_trust_c", "comment": null}, "duration_in_minutes_c": {"type": "integer", "index": 93, "name": "duration_in_minutes_c", "comment": null}, "vidyard_c": {"type": "boolean", "index": 94, "name": "vidyard_c", "comment": null}, "expected_payment_date_c": {"type": "integer", "index": 95, "name": "expected_payment_date_c", "comment": null}, "execute_collections_plan_activity_c": {"type": "boolean", "index": 96, "name": "execute_collections_plan_activity_c", "comment": null}, "collections_hold_c": {"type": "boolean", "index": 97, "name": "collections_hold_c", "comment": null}, "opportunity_c": {"type": "integer", "index": 98, "name": "opportunity_c", "comment": null}, "meeting_type_c": {"type": "text", "index": 99, "name": "meeting_type_c", "comment": null}, "meeting_name_c": {"type": "text", "index": 100, "name": "meeting_name_c", "comment": null}, "bizible_2_bizible_id_c": {"type": "integer", "index": 101, "name": "bizible_2_bizible_id_c", "comment": null}, "bizible_2_bizible_touchpoint_date_c": {"type": "integer", "index": 102, "name": "bizible_2_bizible_touchpoint_date_c", "comment": null}, "assigned_to_role_c": {"type": "text", "index": 103, "name": "assigned_to_role_c", "comment": null}, "assigned_to_name_c": {"type": "text", "index": 104, "name": "assigned_to_name_c", "comment": null}, "legacy_hvr_id_c": {"type": "integer", "index": 105, "name": "legacy_hvr_id_c", "comment": null}, "is_archived": {"type": "boolean", "index": 106, "name": "is_archived", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 107, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.task"}, "source.salesforce_source.salesforce.user": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "about_me": {"type": "integer", "index": 3, "name": "about_me", "comment": null}, "account_id": {"type": "integer", "index": 4, "name": "account_id", "comment": null}, "alias": {"type": "text", "index": 5, "name": "alias", "comment": null}, "badge_text": {"type": "text", "index": 6, "name": "badge_text", "comment": null}, "banner_photo_url": {"type": "text", "index": 7, "name": "banner_photo_url", "comment": null}, "call_center_id": {"type": "integer", "index": 8, "name": "call_center_id", "comment": null}, "city": {"type": "integer", "index": 9, "name": "city", "comment": null}, "community_nickname": {"type": "text", "index": 10, "name": "community_nickname", "comment": null}, "company_name": {"type": "integer", "index": 11, "name": "company_name", "comment": null}, "contact_id": {"type": "integer", "index": 12, "name": "contact_id", "comment": null}, "country": {"type": "text", "index": 13, "name": "country", "comment": null}, "country_code": {"type": "text", "index": 14, "name": "country_code", "comment": null}, "default_group_notification_frequency": {"type": "text", "index": 15, "name": "default_group_notification_frequency", "comment": null}, "delegated_approver_id": {"type": "text", "index": 16, "name": "delegated_approver_id", "comment": null}, "department": {"type": "integer", "index": 17, "name": "department", "comment": null}, "digest_frequency": {"type": "text", "index": 18, "name": "digest_frequency", "comment": null}, "division": {"type": "integer", "index": 19, "name": "division", "comment": null}, "email": {"type": "text", "index": 20, "name": "email", "comment": null}, "email_encoding_key": {"type": "text", "index": 21, "name": "email_encoding_key", "comment": null}, "email_preferences_auto_bcc": {"type": "boolean", "index": 22, "name": "email_preferences_auto_bcc", "comment": null}, "employee_number": {"type": "integer", "index": 23, "name": "employee_number", "comment": null}, "extension": {"type": "integer", "index": 24, "name": "extension", "comment": null}, "fax": {"type": "integer", "index": 25, "name": "fax", "comment": null}, "federation_identifier": {"type": "integer", "index": 26, "name": "federation_identifier", "comment": null}, "first_name": {"type": "text", "index": 27, "name": "first_name", "comment": null}, "forecast_enabled": {"type": "boolean", "index": 28, "name": "forecast_enabled", "comment": null}, "full_photo_url": {"type": "text", "index": 29, "name": "full_photo_url", "comment": null}, "geocode_accuracy": {"type": "integer", "index": 30, "name": "geocode_accuracy", "comment": null}, "id": {"type": "text", "index": 31, "name": "id", "comment": null}, "individual_id": {"type": "integer", "index": 32, "name": "individual_id", "comment": null}, "is_active": {"type": "boolean", "index": 33, "name": "is_active", "comment": null}, "is_profile_photo_active": {"type": "boolean", "index": 34, "name": "is_profile_photo_active", "comment": null}, "language_locale_key": {"type": "text", "index": 35, "name": "language_locale_key", "comment": null}, "last_login_date": {"type": "timestamp without time zone", "index": 36, "name": "last_login_date", "comment": null}, "last_name": {"type": "text", "index": 37, "name": "last_name", "comment": null}, "last_referenced_date": {"type": "timestamp without time zone", "index": 38, "name": "last_referenced_date", "comment": null}, "last_viewed_date": {"type": "timestamp without time zone", "index": 39, "name": "last_viewed_date", "comment": null}, "latitude": {"type": "double precision", "index": 40, "name": "latitude", "comment": null}, "locale_sid_key": {"type": "text", "index": 41, "name": "locale_sid_key", "comment": null}, "longitude": {"type": "double precision", "index": 42, "name": "longitude", "comment": null}, "manager_id": {"type": "text", "index": 43, "name": "manager_id", "comment": null}, "medium_banner_photo_url": {"type": "text", "index": 44, "name": "medium_banner_photo_url", "comment": null}, "mobile_phone": {"type": "integer", "index": 45, "name": "mobile_phone", "comment": null}, "name": {"type": "text", "index": 46, "name": "name", "comment": null}, "offline_trial_expiration_date": {"type": "timestamp without time zone", "index": 47, "name": "offline_trial_expiration_date", "comment": null}, "phone": {"type": "text", "index": 48, "name": "phone", "comment": null}, "postal_code": {"type": "integer", "index": 49, "name": "postal_code", "comment": null}, "profile_id": {"type": "text", "index": 50, "name": "profile_id", "comment": null}, "receives_admin_info_emails": {"type": "boolean", "index": 51, "name": "receives_admin_info_emails", "comment": null}, "receives_info_emails": {"type": "boolean", "index": 52, "name": "receives_info_emails", "comment": null}, "sender_email": {"type": "integer", "index": 53, "name": "sender_email", "comment": null}, "sender_name": {"type": "integer", "index": 54, "name": "sender_name", "comment": null}, "signature": {"type": "integer", "index": 55, "name": "signature", "comment": null}, "small_banner_photo_url": {"type": "text", "index": 56, "name": "small_banner_photo_url", "comment": null}, "small_photo_url": {"type": "text", "index": 57, "name": "small_photo_url", "comment": null}, "state": {"type": "integer", "index": 58, "name": "state", "comment": null}, "state_code": {"type": "integer", "index": 59, "name": "state_code", "comment": null}, "street": {"type": "integer", "index": 60, "name": "street", "comment": null}, "time_zone_sid_key": {"type": "text", "index": 61, "name": "time_zone_sid_key", "comment": null}, "title": {"type": "text", "index": 62, "name": "title", "comment": null}, "user_role_id": {"type": "text", "index": 63, "name": "user_role_id", "comment": null}, "user_type": {"type": "text", "index": 64, "name": "user_type", "comment": null}, "username": {"type": "text", "index": 65, "name": "username", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 66, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.user"}, "source.salesforce_source.salesforce.user_role": {"metadata": {"type": "BASE TABLE", "schema": "zz_salesforce", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "case_access_for_account_owner": {"type": "text", "index": 3, "name": "case_access_for_account_owner", "comment": null}, "contact_access_for_account_owner": {"type": "text", "index": 4, "name": "contact_access_for_account_owner", "comment": null}, "developer_name": {"type": "text", "index": 5, "name": "developer_name", "comment": null}, "forecast_user_id": {"type": "integer", "index": 6, "name": "forecast_user_id", "comment": null}, "id": {"type": "text", "index": 7, "name": "id", "comment": null}, "may_forecast_manager_share": {"type": "boolean", "index": 8, "name": "may_forecast_manager_share", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "opportunity_access_for_account_owner": {"type": "text", "index": 10, "name": "opportunity_access_for_account_owner", "comment": null}, "parent_role_id": {"type": "text", "index": 11, "name": "parent_role_id", "comment": null}, "portal_type": {"type": "text", "index": 12, "name": "portal_type", "comment": null}, "rollup_description": {"type": "text", "index": 13, "name": "rollup_description", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 14, "name": "_fivetran_active", "comment": null}}, "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.salesforce_source.salesforce.user_role"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 6f34347..1c7674a 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.8.3", "generated_at": "2024-07-10T00:47:35.559948Z", "invocation_id": "f1c358ba-eb11-4963-9644-4063866a3763", "env": {}, "project_name": "salesforce_integration_tests", "project_id": "587a8ff6488a773aca368d80d6016991", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.salesforce_integration_tests.sf_lead_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_lead_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_lead_data.csv", "original_file_path": "seeds/sf_lead_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_lead_data", "fqn": ["salesforce_integration_tests", "sf_lead_data"], "alias": "sf_lead_data", "checksum": {"name": "sha256", "checksum": "04c65ab4f75626fc9f14eefd9d65ef15e0523670d782359ab586e73728a4cc60"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "converted_date": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"converted_date": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.104001, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_lead_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_product_2_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_product_2_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_product_2_data.csv", "original_file_path": "seeds/sf_product_2_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_product_2_data", "fqn": ["salesforce_integration_tests", "sf_product_2_data"], "alias": "sf_product_2_data", "checksum": {"name": "sha256", "checksum": "a227b4c050e2eef218b1757e2cf7b282dcc022fb2a4e1d761fc48481e74c7230"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.107467, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_product_2_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_role_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_user_role_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_user_role_data.csv", "original_file_path": "seeds/sf_user_role_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_user_role_data", "fqn": ["salesforce_integration_tests", "sf_user_role_data"], "alias": "sf_user_role_data", "checksum": {"name": "sha256", "checksum": "2f3861fe3fccbbfb3056beab2f7b6b159910bcf898cade04789a6be752bbf996"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean"}}, "created_at": 1720572444.108842, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_role_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_account_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_account_data.csv", "original_file_path": "seeds/sf_account_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_account_data", "fqn": ["salesforce_integration_tests", "sf_account_data"], "alias": "sf_account_data", "checksum": {"name": "sha256", "checksum": "50ebb7785eeb7b560b9c2199d9d0d3686080124b3a37bf571051ea54c6a3c5b4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "annual_revenue": "float", "billing_latitude": "float", "billing_longitude": "float", "shipping_latitude": "float", "shipping_longitude": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "annual_revenue": "float", "billing_latitude": "float", "billing_longitude": "float", "shipping_latitude": "float", "shipping_longitude": "float"}}, "created_at": 1720572444.110372, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_line_item_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_line_item_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_opportunity_line_item_data.csv", "original_file_path": "seeds/sf_opportunity_line_item_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_opportunity_line_item_data", "fqn": ["salesforce_integration_tests", "sf_opportunity_line_item_data"], "alias": "sf_opportunity_line_item_data", "checksum": {"name": "sha256", "checksum": "da3d703e060791ee354dfe83830d026531816141846eda4837b517c5a34b0abd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "service_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "service_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.111806, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_line_item_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_user_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_user_data.csv", "original_file_path": "seeds/sf_user_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_user_data", "fqn": ["salesforce_integration_tests", "sf_user_data"], "alias": "sf_user_data", "checksum": {"name": "sha256", "checksum": "6ca1169abd0988ebf457e230d077fb22c32404626864575d9b87bd9745cc7a55"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "last_login_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "offline_trial_expiration_date": "timestamp", "latitude": "float", "longitude": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"last_login_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "offline_trial_expiration_date": "timestamp", "latitude": "float", "longitude": "float"}}, "created_at": 1720572444.113222, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_contact_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_contact_data.csv", "original_file_path": "seeds/sf_contact_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_contact_data", "fqn": ["salesforce_integration_tests", "sf_contact_data"], "alias": "sf_contact_data", "checksum": {"name": "sha256", "checksum": "e4b8953b2e16533efb7c0bb9f246f64d5b9fad22ed16fb2d65629a02524b78d0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "birthdate": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_curequest_date": "timestamp", "last_cuupdate_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"birthdate": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_curequest_date": "timestamp", "last_cuupdate_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.114657, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_opportunity_data.csv", "original_file_path": "seeds/sf_opportunity_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_opportunity_data", "fqn": ["salesforce_integration_tests", "sf_opportunity_data"], "alias": "sf_opportunity_data", "checksum": {"name": "sha256", "checksum": "6a109616a284522a02550d21119c0257d788a33d01b2ded463808a467266873a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "probability": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "probability": "float"}}, "created_at": 1720572444.116148, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_history_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_opportunity_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_opportunity_history_data.csv", "original_file_path": "seeds/sf_opportunity_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_opportunity_history_data", "fqn": ["salesforce_integration_tests", "sf_opportunity_history_data"], "alias": "sf_opportunity_history_data", "checksum": {"name": "sha256", "checksum": "a28441bbd95128aa6440a32b8faec0a21cec1f6e3eae8ff804ba2bdcb499381f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "expected_revenue": "float", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "expected_revenue": "float", "is_deleted": "boolean"}}, "created_at": 1720572444.1175702, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_history_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_order_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_order_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_order_data.csv", "original_file_path": "seeds/sf_order_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_order_data", "fqn": ["salesforce_integration_tests", "sf_order_data"], "alias": "sf_order_data", "checksum": {"name": "sha256", "checksum": "4cf8cc6e6eb58e8e502f3204fd430468b1c63e35766c56f2fd3029a6988f06f4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activated_date": "timestamp", "created_date": "timestamp", "effective_date": "timestamp", "end_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"activated_date": "timestamp", "created_date": "timestamp", "effective_date": "timestamp", "end_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.1190012, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_order_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_event_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_event_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_event_data.csv", "original_file_path": "seeds/sf_event_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_event_data", "fqn": ["salesforce_integration_tests", "sf_event_data"], "alias": "sf_event_data", "checksum": {"name": "sha256", "checksum": "7dc5596105508d36674a5019e42592dd7cc48391842da432c7d02f46b63f820a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activity_date": "timestamp", "activity_date_time": "timestamp", "created_date": "timestamp", "end_date": "timestamp", "end_date_time": "timestamp", "last_modified_date": "timestamp", "recurrence_2_pattern_start_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_time": "timestamp", "reminder_date_time": "timestamp", "start_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"activity_date": "timestamp", "activity_date_time": "timestamp", "created_date": "timestamp", "end_date": "timestamp", "end_date_time": "timestamp", "last_modified_date": "timestamp", "recurrence_2_pattern_start_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_time": "timestamp", "reminder_date_time": "timestamp", "start_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.12048, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_event_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_history_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_contact_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_contact_history_data.csv", "original_file_path": "seeds/sf_contact_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_contact_history_data", "fqn": ["salesforce_integration_tests", "sf_contact_history_data"], "alias": "sf_contact_history_data", "checksum": {"name": "sha256", "checksum": "2a872395946af58b6d08eb9be088c1ca2f2e9ffe0b224c3bbcd92086ad2e6507"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "birthdate": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"birthdate": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.121921, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_history_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_history_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_account_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_account_history_data.csv", "original_file_path": "seeds/sf_account_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_account_history_data", "fqn": ["salesforce_integration_tests", "sf_account_history_data"], "alias": "sf_account_history_data", "checksum": {"name": "sha256", "checksum": "e19660a78e56a685df80329bfbcf71324f09a2d5a421540f5fa34cd23d740dcb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "annual_revenue": "float", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"annual_revenue": "float", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.123347, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_history_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_task_data": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "sf_task_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_task_data.csv", "original_file_path": "seeds/sf_task_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_task_data", "fqn": ["salesforce_integration_tests", "sf_task_data"], "alias": "sf_task_data", "checksum": {"name": "sha256", "checksum": "b885e6f9737a8e1695c90c0dbbcfbbf3d4849bf3bbc7aba808b44c6d8eac772c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activity_date": "timestamp", "completed_date_time": "timestamp", "created_date": "timestamp", "last_modified_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_only": "timestamp", "reminder_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"activity_date": "timestamp", "completed_date_time": "timestamp", "created_date": "timestamp", "last_modified_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_only": "timestamp", "reminder_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1720572444.124778, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_task_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "model.salesforce.salesforce__contact_daily_history": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__contact_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__contact_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__contact_daily_history.sql", "unique_id": "model.salesforce.salesforce__contact_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__contact_daily_history"], "alias": "salesforce__contact_daily_history", "checksum": {"name": "sha256", "checksum": "d42a70ca24d744be0f8bedf78e2e5e6e013fa2f019af3d5846527e6a56d40601"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "contact_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Each record is a daily record in a contact, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"contact_day_id": {"name": "contact_day_id", "description": "Surrogate key hashed on `date_day` and `contact_id`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "contact_day_id", "incremental_strategy": "delete+insert", "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.7234402, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__contact_history_enabled', False),\n materialized = 'incremental',\n partition_by = {\n 'field': 'date_day', \n 'data_type': 'date'\n } if target.type not in ['spark', 'databricks'] else ['date_day'],\n unique_key = 'contact_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'parquet',\n on_schema_change = 'fail'\n )\n}}\n\n{% if execute %}\n {% set date_query %}\n select \n {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date\n {% endset %}\n\n {% set last_date = run_query(date_query).columns[0][0]|string %}\n\n {# If only compiling, creates range going back 1 year #}\n {% else %} \n {% set last_date = dbt.dateadd(\"year\", \"-1\", \"current_date\") %}\n {% endif %}\n\n\nwith spine as (\n {# Prioritizes variables over calculated dates #}\n {% set first_date = var('contact_history_start_date', var('global_history_start_date', '2020-01-01'))|string %}\n {% set last_date = last_date|string %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\",\n end_date = \"cast('\" ~ last_date[0:10] ~ \"'as date)\"\n )\n }}\n),\n\ncontact_history as (\n\n select * \n from {{ var('contact_history') }}\n {% if is_incremental() %}\n where _fivetran_start >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% endif %} \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, contact_id\n order by _fivetran_start desc) as row_num \n from contact_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.contact_id']) }} as contact_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }})\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }})\n)\n\nselect * \nfrom daily_history", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.run_query"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__contact_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1652\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-10'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncontact_history as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, contact_id\n order by _fivetran_start desc) as row_num \n from contact_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.contact_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as contact_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_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}, "model.salesforce.salesforce__opportunity_daily_history": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__opportunity_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__opportunity_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__opportunity_daily_history.sql", "unique_id": "model.salesforce.salesforce__opportunity_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__opportunity_daily_history"], "alias": "salesforce__opportunity_daily_history", "checksum": {"name": "sha256", "checksum": "30a4d6d24c726b6bba850f4fc28c2ce92a19a2e45aa887833021ebf8b672c548"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "opportunity_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Each record is a daily record in an opportunity, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"opportunity_day_id": {"name": "opportunity_day_id", "description": "Surrogate key hashed on `date_day` and `opportunity_id`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "opportunity_day_id", "incremental_strategy": "delete+insert", "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.728393, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__opportunity_history_enabled', False),\n materialized = 'incremental',\n partition_by = {\n 'field': 'date_day', \n 'data_type': 'date'\n } if target.type not in ['spark', 'databricks'] else ['date_day'],\n unique_key = 'opportunity_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'parquet',\n on_schema_change = 'fail'\n )\n}}\n\n\n{% if execute %}\n {% set date_query %}\n select \n {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date\n {% endset %}\n\n {% set last_date = run_query(date_query).columns[0][0]|string %}\n\n {# If only compiling, creates range going back 1 year #}\n {% else %} \n {% set last_date = dbt.dateadd(\"year\", \"-1\", \"current_date\") %}\n {% endif %}\n\n\nwith spine as (\n {# Prioritizes variables over calculated dates #}\n {% set first_date = var('opportunity_history_start_date', var('global_history_start_date', '2020-01-01'))|string %}\n {% set last_date = last_date|string %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\",\n end_date = \"cast('\" ~ last_date[0:10] ~ \"'as date)\"\n )\n }}\n),\n\nopportunity_history as (\n\n select * \n from {{ var('opportunity_history') }}\n {% if is_incremental() %}\n where _fivetran_start >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% endif %} \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, opportunity_id\n order by _fivetran_start desc) as row_num \n from opportunity_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.opportunity_id']) }} as opportunity_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }})\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }})\n)\n\nselect * \nfrom daily_history", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.run_query"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__opportunity_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1652\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-10'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\nopportunity_history as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, opportunity_id\n order by _fivetran_start desc) as row_num \n from opportunity_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.opportunity_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as opportunity_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_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}, "model.salesforce.salesforce__account_daily_history": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__account_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__account_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__account_daily_history.sql", "unique_id": "model.salesforce.salesforce__account_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__account_daily_history"], "alias": "salesforce__account_daily_history", "checksum": {"name": "sha256", "checksum": "ab3781e38a81a1da1c83c76ea2a8fa284be86c6cd05cd0f77281d0d3444d4a97"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "account_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Each record is a daily record in an account, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"account_day_id": {"name": "account_day_id", "description": "Surrogate key hashed on `date_day` and `account_id`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Date on which the account had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "account_day_id", "incremental_strategy": "delete+insert", "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.719061, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__account_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__account_history_enabled', False),\n materialized = 'incremental',\n partition_by = {\n 'field': 'date_day', \n 'data_type': 'date'\n } if target.type not in ['spark', 'databricks'] else ['date_day'],\n unique_key = 'account_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'parquet',\n on_schema_change = 'fail'\n )\n}}\n\n{% if execute %}\n {% set date_query %}\n select \n {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date\n {% endset %}\n\n {% set last_date = run_query(date_query).columns[0][0]|string %}\n\n {# If only compiling, creates range going back 1 year #}\n {% else %} \n {% set last_date = dbt.dateadd(\"year\", \"-1\", \"current_date\") %}\n {% endif %}\n\n\nwith spine as (\n {# Prioritizes variables over calculated dates #}\n {% set first_date = var('account_history_start_date', var('global_history_start_date', '2020-01-01'))|string %}\n {% set last_date = last_date|string %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\",\n end_date = \"cast('\" ~ last_date[0:10] ~ \"'as date)\"\n )\n }}\n),\n\naccount_history as (\n\n select * \n from {{ var('account_history') }}\n {% if is_incremental() %}\n where _fivetran_start >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% endif %} \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, account_id\n order by _fivetran_start desc) as row_num \n from account_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.account_id']) }} as account_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }})\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }})\n)\n\nselect * \nfrom daily_history", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.run_query"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__account_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1652\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-10'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\naccount_history as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, account_id\n order by _fivetran_start desc) as row_num \n from account_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.account_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as account_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_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}, "model.salesforce.salesforce__opportunity_enhanced": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__opportunity_enhanced", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__opportunity_enhanced.sql", "original_file_path": "models/salesforce/salesforce__opportunity_enhanced.sql", "unique_id": "model.salesforce.salesforce__opportunity_enhanced", "fqn": ["salesforce", "salesforce", "salesforce__opportunity_enhanced"], "alias": "salesforce__opportunity_enhanced", "checksum": {"name": "sha256", "checksum": "7913bd625bdc80f24f5cc863c610512e0f62c44b2b8a4efeaaee36bf5e0cb371"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "This table both cleans and enhances your opportunities source table with information about the associate account and opportunity owner.\n", "columns": {"opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Number of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_amount_this_month": {"name": "closed_amount_this_month", "description": "The opportunity amount, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_amount_this_quarter": {"name": "closed_amount_this_quarter", "description": "The opportunity amount, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_count_this_month": {"name": "closed_count_this_month", "description": "The opportunity count, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_count_this_quarter": {"name": "closed_count_this_quarter", "description": "The opportunity count, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_amount_this_month": {"name": "created_amount_this_month", "description": "The opportunity amount, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_amount_this_quarter": {"name": "created_amount_this_quarter", "description": "The opportunity amount, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_count_this_month": {"name": "created_count_this_month", "description": "The opportunity count, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_count_this_quarter": {"name": "created_count_this_quarter", "description": "The opportunity count, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_since_created": {"name": "days_since_created", "description": "The difference in days between the current day and the day the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_close": {"name": "days_to_close", "description": "The difference in days between the close day and the day the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "The category of the state of the opportunity. Default values are 'pipeline','forecast','bestcase','closed', and 'omited'", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_month": {"name": "is_closed_this_month", "description": "Boolean field, indicating whether the closed month is equal to the current month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_quarter": {"name": "is_closed_this_quarter", "description": "Boolean field, indicating whether the closed quarter is equal to the current quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_month": {"name": "is_created_this_month", "description": "Boolean field, indicating whether the created date is greater than or equal to the first day of this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_quarter": {"name": "is_created_this_quarter", "description": "Boolean field, indicating whether the created date is greater than or equal to the first day of this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_account_id": {"name": "opportunity_account_id", "description": "The id of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_city": {"name": "opportunity_manager_city", "description": "The city associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_id": {"name": "opportunity_manager_id", "description": "The Id of the user who manages this owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_name": {"name": "opportunity_manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_state": {"name": "opportunity_manager_state", "description": "The state associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_city": {"name": "opportunity_owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_id": {"name": "opportunity_owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_name": {"name": "opportunity_owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_state": {"name": "opportunity_owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_role_id": {"name": "opportunity_owner_role_id", "description": "The ID associated with the owner's user role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Id of the owner of this opportunity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Whether the opportunity is won, lost, in the pipeline, or other.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_position": {"name": "opportunity_owner_position", "description": "Name of the position of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_developer_name": {"name": "opportunity_owner_developer_name", "description": "The name of the object of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_parent_role_id": {"name": "opportunity_owner_parent_role_id", "description": "The ID of the parent role of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_rollup_description": {"name": "opportunity_owner_rollup_description", "description": "Description of the forecast rollup of the opportunity owner..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.783015, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"", "raw_code": "with opportunity as (\n\n select *\n from {{ var('opportunity') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n{% if var('salesforce__user_role_enabled', True) %}\nuser_role as (\n\n select *\n from {{ var('user_role') }}\n), \n{% endif %}\n\naccount as (\n\n select *\n from {{ var('account') }}\n), \n\nadd_fields as (\n\n select \n opportunity.*,\n account.account_number,\n account.account_source,\n account.industry,\n account.account_name,\n account.number_of_employees,\n account.type as account_type,\n opportunity_owner.user_id as opportunity_owner_id,\n opportunity_owner.user_name as opportunity_owner_name,\n opportunity_owner.user_role_id as opportunity_owner_role_id,\n opportunity_owner.city opportunity_owner_city,\n opportunity_owner.state as opportunity_owner_state,\n opportunity_manager.user_id as opportunity_manager_id,\n opportunity_manager.user_name as opportunity_manager_name,\n opportunity_manager.city opportunity_manager_city,\n opportunity_manager.state as opportunity_manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n user_role.user_role_name as opportunity_owner_position, \n user_role.developer_name as opportunity_owner_developer_name,\n user_role.parent_role_id as opportunity_owner_parent_role_id,\n user_role.rollup_description as opportunity_owner_rollup_description,\n {% endif %}\n\n case\n when opportunity.is_won then 'Won'\n when not opportunity.is_won and opportunity.is_closed then 'Lost'\n when not opportunity.is_closed and lower(opportunity.forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status,\n case when is_created_this_month then amount else 0 end as created_amount_this_month,\n case when is_created_this_quarter then amount else 0 end as created_amount_this_quarter,\n case when is_created_this_month then 1 else 0 end as created_count_this_month,\n case when is_created_this_quarter then 1 else 0 end as created_count_this_quarter,\n case when is_closed_this_month then amount else 0 end as closed_amount_this_month,\n case when is_closed_this_quarter then amount else 0 end as closed_amount_this_quarter,\n case when is_closed_this_month then 1 else 0 end as closed_count_this_month,\n case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__account_pass_through_columns', identifier='account') }}\n {{ custom_persist_pass_through_columns(pass_through_variable='salesforce__user_pass_through_columns', identifier='opportunity_owner', append_string= '_owner') }}\n {{ custom_persist_pass_through_columns(pass_through_variable='salesforce__user_pass_through_columns', identifier='opportunity_manager', append_string= '_manager') }}\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__user_role_pass_through_columns', identifier='user_role') }}\n {% endif %}\n\n from opportunity\n left join account \n on opportunity.account_id = account.account_id\n left join salesforce_user as opportunity_owner \n on opportunity.owner_id = opportunity_owner.user_id\n left join salesforce_user as opportunity_manager \n on opportunity_owner.manager_id = opportunity_manager.user_id\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n left join user_role \n on opportunity_owner.user_role_id = user_role.user_role_id\n {% endif %}\n)\n\nselect *\nfrom add_fields", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}, {"name": "stg_salesforce__user_role", "package": null, "version": null}, {"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.salesforce.custom_persist_pass_through_columns"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity", "model.salesforce_source.stg_salesforce__user", "model.salesforce_source.stg_salesforce__user_role", "model.salesforce_source.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__opportunity_enhanced.sql", "compiled": true, "compiled_code": "with opportunity as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\n), \n\n\naccount as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\n), \n\nadd_fields as (\n\n select \n opportunity.*,\n account.account_number,\n account.account_source,\n account.industry,\n account.account_name,\n account.number_of_employees,\n account.type as account_type,\n opportunity_owner.user_id as opportunity_owner_id,\n opportunity_owner.user_name as opportunity_owner_name,\n opportunity_owner.user_role_id as opportunity_owner_role_id,\n opportunity_owner.city opportunity_owner_city,\n opportunity_owner.state as opportunity_owner_state,\n opportunity_manager.user_id as opportunity_manager_id,\n opportunity_manager.user_name as opportunity_manager_name,\n opportunity_manager.city opportunity_manager_city,\n opportunity_manager.state as opportunity_manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as opportunity_owner_position, \n user_role.developer_name as opportunity_owner_developer_name,\n user_role.parent_role_id as opportunity_owner_parent_role_id,\n user_role.rollup_description as opportunity_owner_rollup_description,\n \n\n case\n when opportunity.is_won then 'Won'\n when not opportunity.is_won and opportunity.is_closed then 'Lost'\n when not opportunity.is_closed and lower(opportunity.forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status,\n case when is_created_this_month then amount else 0 end as created_amount_this_month,\n case when is_created_this_quarter then amount else 0 end as created_amount_this_quarter,\n case when is_created_this_month then 1 else 0 end as created_count_this_month,\n case when is_created_this_quarter then 1 else 0 end as created_count_this_quarter,\n case when is_closed_this_month then amount else 0 end as closed_amount_this_month,\n case when is_closed_this_quarter then amount else 0 end as closed_amount_this_quarter,\n case when is_closed_this_month then 1 else 0 end as closed_count_this_month,\n case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter\n\n --The below script allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n \n\n\n\n\n \n\n from opportunity\n left join account \n on opportunity.account_id = account.account_id\n left join salesforce_user as opportunity_owner \n on opportunity.owner_id = opportunity_owner.user_id\n left join salesforce_user as opportunity_manager \n on opportunity_owner.manager_id = opportunity_manager.user_id\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n left join user_role \n on opportunity_owner.user_role_id = user_role.user_role_id\n \n)\n\nselect *\nfrom add_fields", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__owner_performance": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__owner_performance", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__owner_performance.sql", "original_file_path": "models/salesforce/salesforce__owner_performance.sql", "unique_id": "model.salesforce.salesforce__owner_performance", "fqn": ["salesforce", "salesforce", "salesforce__owner_performance"], "alias": "salesforce__owner_performance", "checksum": {"name": "sha256", "checksum": "b34d062ed9c77478e003931345d7248ee952d66ef88b213d4a72889c9cabba0a"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents an individual member of the sales team, enriched with data about their pipeline, bookings, loses, and win percentages.", "columns": {"owner_id": {"name": "owner_id", "description": "Id of the owner of this opportunity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_bookings_amount": {"name": "avg_bookings_amount", "description": "The average opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The average days since created across opportunties in the pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_to_close": {"name": "avg_days_to_close", "description": "The average days to close across opportunties in that have been won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_pipeline_opp_amount": {"name": "avg_pipeline_opp_amount", "description": "The average opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "b_manager_id": {"name": "b_manager_id", "description": "Manager ID of the booking_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "b_owner_id": {"name": "b_owner_id", "description": "Owner ID of the booking_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "description": "The opportunity amount, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "description": "The opportunity amount, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "description": "The opportunity count, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "description": "The opportunity count, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "l_manager_id": {"name": "l_manager_id", "description": "Manager ID of the lost_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "l_owner_id": {"name": "l_owner_id", "description": "Owner ID of the lost_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "description": "The largest amount associated with a single opportunity in the current pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_month": {"name": "lost_amount_this_month", "description": "The opportunity amount, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_month": {"name": "lost_count_this_month", "description": "The opportunity count, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_quarter": {"name": "lost_count_this_quarter", "description": "The opportunity count, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_id": {"name": "manager_id", "description": "Manager ID associated with opportunities.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_city": {"name": "owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_name": {"name": "owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_state": {"name": "owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "p_manager_id": {"name": "p_manager_id", "description": "Manager ID of the pipeline_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "p_owner_id": {"name": "p_owner_id", "description": "Owner ID of the pipeline_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "description": "The opportunity count, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "description": "The opportunity count, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "description": "The opportunity amount, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "description": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_win_percent": {"name": "total_win_percent", "description": "The booking amount closed, divided by the sum of the booking amount and the lost amount..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_month": {"name": "win_percent_this_month", "description": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_quarter": {"name": "win_percent_this_quarter", "description": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.777065, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__owner_performance\"", "raw_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from {{ ref('int_salesforce__opportunity_aggregation_by_owner') }} \n), \n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n)\n\nselect \n opportunity_aggregation_by_owner.*,\n salesforce_user.user_name as owner_name,\n salesforce_user.city as owner_city,\n salesforce_user.state as owner_state,\n case \n when (bookings_amount_closed_this_month + lost_amount_this_month) > 0 \n then bookings_amount_closed_this_month / (bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0 \n end as win_percent_this_month,\n case \n when (bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 \n then bookings_amount_closed_this_quarter / (bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0 \n end as win_percent_this_quarter,\n case \n when (total_bookings_amount + total_lost_amount) > 0 \n then total_bookings_amount / (total_bookings_amount + total_lost_amount) * 100\n else 0 \n end as total_win_percent\nfrom opportunity_aggregation_by_owner\njoin salesforce_user \n on salesforce_user.user_id = opportunity_aggregation_by_owner.owner_id", "language": "sql", "refs": [{"name": "int_salesforce__opportunity_aggregation_by_owner", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__owner_performance.sql", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\" \n), \n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n)\n\nselect \n opportunity_aggregation_by_owner.*,\n salesforce_user.user_name as owner_name,\n salesforce_user.city as owner_city,\n salesforce_user.state as owner_state,\n case \n when (bookings_amount_closed_this_month + lost_amount_this_month) > 0 \n then bookings_amount_closed_this_month / (bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0 \n end as win_percent_this_month,\n case \n when (bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 \n then bookings_amount_closed_this_quarter / (bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0 \n end as win_percent_this_quarter,\n case \n when (total_bookings_amount + total_lost_amount) > 0 \n then total_bookings_amount / (total_bookings_amount + total_lost_amount) * 100\n else 0 \n end as total_win_percent\nfrom opportunity_aggregation_by_owner\njoin salesforce_user \n on salesforce_user.user_id = opportunity_aggregation_by_owner.owner_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__opportunity_line_item_enhanced": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__opportunity_line_item_enhanced", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__opportunity_line_item_enhanced.sql", "original_file_path": "models/salesforce/salesforce__opportunity_line_item_enhanced.sql", "unique_id": "model.salesforce.salesforce__opportunity_line_item_enhanced", "fqn": ["salesforce", "salesforce", "salesforce__opportunity_line_item_enhanced"], "alias": "salesforce__opportunity_line_item_enhanced", "checksum": {"name": "sha256", "checksum": "be07c8078b92a71998ec55013b11dd184eaf1d2fcc29be8084c5076a7aa0deb9"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a line item belonging to a certain opportunity, with additional product details.", "columns": {"opportunity_line_item_id": {"name": "opportunity_line_item_id", "description": "Unique id for each record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_name": {"name": "opportunity_line_item_name", "description": "The unique name for each opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID of the associated Opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "line_item_index": {"name": "line_item_index", "description": "The index number of the specific line item, relative to all line items in that opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_line_items": {"name": "total_line_items", "description": "The total number of line items belonging to the same opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_date": {"name": "service_date", "description": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_entry_id": {"name": "pricebook_entry_id", "description": "ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_id": {"name": "product_2_id", "description": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later.\nUse the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_name": {"name": "product_2_name", "description": "Default name of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_description": {"name": "product_2_description", "description": "A text description of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "list_price": {"name": "list_price", "description": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule.\nWhen updating these records:\nIf you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant.\nIf you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unit_price": {"name": "unit_price", "description": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price.\nThis field or TotalPrice is required. You can\u2019t specify both.\n\nIf you specify Discount and Quantity, this field or TotalPrice is required.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem.\nIf you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\n\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_quantity_schedule": {"name": "has_quantity_schedule", "description": "Indicates whether a quantity schedule has been created for this object (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_revenue_schedule": {"name": "has_revenue_schedule", "description": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_external_id": {"name": "product_external_id", "description": "The unique identifier of the product in the linked external data source. For example, ID #123.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_family": {"name": "product_family", "description": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_is_active": {"name": "product_is_active", "description": "Indicates whether product is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_is_archived": {"name": "product_is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_is_deleted": {"name": "product_is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_number_of_quantity_installments": {"name": "product_number_of_quantity_installments", "description": "If the product has a quantity schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_quantity_installment_period": {"name": "product_quantity_installment_period", "description": "If the product has a quantity schedule, the amount of time covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_quantity_schedule_type": {"name": "product_quantity_schedule_type", "description": "The type of the quantity schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_quantity_unit_of_measure": {"name": "product_quantity_unit_of_measure", "description": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_number_of_revenue_installments": {"name": "product_number_of_revenue_installments", "description": "If the product has a revenue schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_revenue_installment_period": {"name": "product_revenue_installment_period", "description": "If the product has a revenue schedule, the time period covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_revenue_schedule_type": {"name": "product_revenue_schedule_type", "description": "The type of the revenue schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.793816, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"", "raw_code": "--This model will only run if you have the underlying opportunity line item table.\n{{ config(enabled=var('salesforce__opportunity_line_item_enabled', True))}}\nwith opportunity_line_item as (\n \n select *\n from {{ var('opportunity_line_item') }}\n),\n\n-- If using product_2 table, the following will be included, otherwise it will not.\n{% if var('salesforce__product_2_enabled', True) %}\nproduct_2 as (\n\n select * \n from {{ var('product_2') }}\n),\n{% endif %}\n\n\nfinal as (\n\n select\n oli.opportunity_line_item_id,\n oli.opportunity_line_item_name,\n oli.opportunity_line_item_description,\n oli.opportunity_id,\n row_number() over (partition by oli.opportunity_id order by oli.created_date) as line_item_index,\n count(opportunity_line_item_id) over (partition by oli.opportunity_id) as total_line_items,\n oli.created_date,\n oli.last_modified_date,\n oli.service_date,\n oli.pricebook_entry_id,\n oli.product_2_id,\n oli.list_price,\n oli.quantity,\n oli.unit_price,\n oli.total_price,\n oli.has_quantity_schedule,\n oli.has_revenue_schedule\n\n {% if var('salesforce__product_2_enabled', True) %}\n ,\n product_2.product_2_name,\n product_2.product_code,\n product_2.product_2_description,\n product_2.external_id as product_external_id,\n product_2.family as product_family,\n product_2.is_active as product_is_active,\n product_2.is_archived as product_is_archived,\n product_2.is_deleted as product_is_deleted,\n product_2.number_of_quantity_installments as product_number_of_quantity_installments,\n product_2.quantity_installment_period as product_quantity_installment_period,\n product_2.quantity_schedule_type as product_quantity_schedule_type,\n product_2.quantity_unit_of_measure as product_quantity_unit_of_measure,\n product_2.number_of_revenue_installments as product_number_of_revenue_installments,\n product_2.revenue_installment_period as product_revenue_installment_period,\n product_2.revenue_schedule_type as product_revenue_schedule_type\n {% endif %}\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__opportunity_line_item_pass_through_columns', identifier='oli') }}\n\n {% if var('salesforce__product_2_enabled', True) %}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__product_2_pass_through_columns', identifier='product_2') }}\n {% endif %}\n\n from opportunity_line_item as oli\n\n {% if var('salesforce__product_2_enabled', True) %}\n left join product_2\n on oli.product_2_id = product_2.product_2_id\n {% endif %}\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}, {"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_line_item", "model.salesforce_source.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__opportunity_line_item_enhanced.sql", "compiled": true, "compiled_code": "--This model will only run if you have the underlying opportunity line item table.\n\nwith opportunity_line_item as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"\n),\n\n-- If using product_2 table, the following will be included, otherwise it will not.\n\nproduct_2 as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"\n),\n\n\n\nfinal as (\n\n select\n oli.opportunity_line_item_id,\n oli.opportunity_line_item_name,\n oli.opportunity_line_item_description,\n oli.opportunity_id,\n row_number() over (partition by oli.opportunity_id order by oli.created_date) as line_item_index,\n count(opportunity_line_item_id) over (partition by oli.opportunity_id) as total_line_items,\n oli.created_date,\n oli.last_modified_date,\n oli.service_date,\n oli.pricebook_entry_id,\n oli.product_2_id,\n oli.list_price,\n oli.quantity,\n oli.unit_price,\n oli.total_price,\n oli.has_quantity_schedule,\n oli.has_revenue_schedule\n\n \n ,\n product_2.product_2_name,\n product_2.product_code,\n product_2.product_2_description,\n product_2.external_id as product_external_id,\n product_2.family as product_family,\n product_2.is_active as product_is_active,\n product_2.is_archived as product_is_archived,\n product_2.is_deleted as product_is_deleted,\n product_2.number_of_quantity_installments as product_number_of_quantity_installments,\n product_2.quantity_installment_period as product_quantity_installment_period,\n product_2.quantity_schedule_type as product_quantity_schedule_type,\n product_2.quantity_unit_of_measure as product_quantity_unit_of_measure,\n product_2.number_of_revenue_installments as product_number_of_revenue_installments,\n product_2.revenue_installment_period as product_revenue_installment_period,\n product_2.revenue_schedule_type as product_revenue_schedule_type\n \n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n \n \n\n\n\n\n \n\n from opportunity_line_item as oli\n\n \n left join product_2\n on oli.product_2_id = product_2.product_2_id\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}, "model.salesforce.salesforce__sales_snapshot": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__sales_snapshot", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__sales_snapshot.sql", "original_file_path": "models/salesforce/salesforce__sales_snapshot.sql", "unique_id": "model.salesforce.salesforce__sales_snapshot", "fqn": ["salesforce", "salesforce", "salesforce__sales_snapshot"], "alias": "salesforce__sales_snapshot", "checksum": {"name": "sha256", "checksum": "1cfeacec22cf324b8b57dad4169b8278215785ed110492e75ab82a1ffafa09a8"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "This snapshot provides monthly and quarterly metrics that help you understand how your opportunities are performing. Metrics around bookings, the current pipeline and loses are included.\n", "columns": {"avg_bookings_amount": {"name": "avg_bookings_amount", "description": "The average opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The average days since created across opportunties in the pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_to_close": {"name": "avg_days_to_close", "description": "The average days to close across opportunties in that have been won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_pipeline_opp_amount": {"name": "avg_pipeline_opp_amount", "description": "The average opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "description": "The opportunity amount, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "description": "The opportunity amount, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "description": "The opportunity count, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "description": "The opportunity count, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "description": "The largest amount associated with a single opportunity in the current pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_month": {"name": "lost_amount_this_month", "description": "The opportunity amount, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_month": {"name": "lost_count_this_month", "description": "The opportunity count, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_quarter": {"name": "lost_count_this_quarter", "description": "The opportunity count, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "description": "The opportunity count, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "description": "The opportunity count, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "description": "The opportunity amount, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "description": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_win_percent": {"name": "total_win_percent", "description": "The booking amount closed, divided by the sum of the booking amount and the lost amount..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_month": {"name": "win_percent_this_month", "description": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_quarter": {"name": "win_percent_this_quarter", "description": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.783927, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__sales_snapshot\"", "raw_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from {{ ref('salesforce__opportunity_enhanced') }}\n), \n\npipeline as (\n\n select \n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n), \n\nbookings as (\n\n select \n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n), \n\nlost as (\n\n select \n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n)\n\nselect \n bookings.*,\n pipeline.*,\n lost.*,\n case \n when (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) = 0 then null\n else round( (bookings.bookings_amount_closed_this_month / (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) ) * 100, 2 )\n end as win_percent_this_month,\n case \n when (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) = 0 then null\n else round( (bookings.bookings_amount_closed_this_quarter / (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) ) * 100, 2 ) \n end as win_percent_this_quarter,\n case \n when (bookings.total_bookings_amount + lost.total_lost_amount) = 0 then null \n else round( (bookings.total_bookings_amount / (bookings.total_bookings_amount + lost.total_lost_amount) ) * 100, 2) \n end as total_win_percent\nfrom bookings, pipeline, lost", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.salesforce__opportunity_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__sales_snapshot.sql", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\npipeline as (\n\n select \n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n), \n\nbookings as (\n\n select \n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n), \n\nlost as (\n\n select \n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n)\n\nselect \n bookings.*,\n pipeline.*,\n lost.*,\n case \n when (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) = 0 then null\n else round( (bookings.bookings_amount_closed_this_month / (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) ) * 100, 2 )\n end as win_percent_this_month,\n case \n when (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) = 0 then null\n else round( (bookings.bookings_amount_closed_this_quarter / (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) ) * 100, 2 ) \n end as win_percent_this_quarter,\n case \n when (bookings.total_bookings_amount + lost.total_lost_amount) = 0 then null \n else round( (bookings.total_bookings_amount / (bookings.total_bookings_amount + lost.total_lost_amount) ) * 100, 2) \n end as total_win_percent\nfrom bookings, pipeline, lost", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__contact_enhanced": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__contact_enhanced", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__contact_enhanced.sql", "original_file_path": "models/salesforce/salesforce__contact_enhanced.sql", "unique_id": "model.salesforce.salesforce__contact_enhanced", "fqn": ["salesforce", "salesforce", "salesforce__contact_enhanced"], "alias": "salesforce__contact_enhanced", "checksum": {"name": "sha256", "checksum": "90b63ae905189a4e582a71361dfe08380294fbc0472d787e463ed1a8e1e747d7"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a contact with additional account and owner information.", "columns": {"contact_id": {"name": "contact_id", "description": "Unique contact ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Name of contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of contact's account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_is_deleted": {"name": "contact_is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either:\nDue date of the most recent event logged against the record.\nDue date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country_code": {"name": "mailing_country_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state_code": {"name": "mailing_state_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_owner_id": {"name": "contact_owner_id", "description": "The ID of the owner of the account associated with this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true.\nThis is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_owner_name": {"name": "contact_owner_name", "description": "Name of owner of the account associated with this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_annual_revenue": {"name": "account_annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_industry": {"name": "account_industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_is_deleted": {"name": "account_is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number_of_employees": {"name": "account_number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_owner_id": {"name": "account_owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_parent_id": {"name": "account_parent_id", "description": "ID of the account parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_rating": {"name": "account_rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.786766, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_enhanced\"", "raw_code": "with contact as (\n\n select *\n from {{ var('contact') }}\n), \n\naccount as (\n\n select *\n from {{ var('account') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n)\n\nselect \n contact.contact_id,\n contact.contact_name,\n contact.account_id,\n contact.department,\n contact.contact_description,\n contact.email,\n contact.individual_id,\n contact.is_deleted as contact_is_deleted,\n contact.last_activity_date,\n contact.lead_source,\n contact.mailing_city,\n contact.mailing_country,\n contact.mailing_country_code,\n contact.mailing_postal_code,\n contact.mailing_state,\n contact.mailing_state_code,\n contact.mailing_street,\n contact.master_record_id,\n contact.mobile_phone,\n contact.owner_id as contact_owner_id,\n contact.phone,\n contact.reports_to_id,\n salesforce_user.user_name as contact_owner_name,\n account.account_name,\n account.account_number,\n account.account_source,\n account.annual_revenue as account_annual_revenue,\n account.account_description,\n account.industry as account_industry,\n account.is_deleted as account_is_deleted,\n account.number_of_employees as account_number_of_employees,\n account.owner_id as account_owner_id,\n account.parent_id as account_parent_id,\n account.rating as account_rating,\n account.type as account_type\n\n --The below scripts allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__contact_pass_through_columns', identifier='contact') }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__account_pass_through_columns', identifier='account') }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__user_pass_through_columns', identifier='salesforce_user') }}\n\nfrom contact\nleft join account \n on contact.account_id = account.account_id\nleft join salesforce_user\n on contact.owner_id = salesforce_user.user_id", "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}, {"name": "stg_salesforce__account", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce_source.stg_salesforce__contact", "model.salesforce_source.stg_salesforce__account", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__contact_enhanced.sql", "compiled": true, "compiled_code": "with contact as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"\n), \n\naccount as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n)\n\nselect \n contact.contact_id,\n contact.contact_name,\n contact.account_id,\n contact.department,\n contact.contact_description,\n contact.email,\n contact.individual_id,\n contact.is_deleted as contact_is_deleted,\n contact.last_activity_date,\n contact.lead_source,\n contact.mailing_city,\n contact.mailing_country,\n contact.mailing_country_code,\n contact.mailing_postal_code,\n contact.mailing_state,\n contact.mailing_state_code,\n contact.mailing_street,\n contact.master_record_id,\n contact.mobile_phone,\n contact.owner_id as contact_owner_id,\n contact.phone,\n contact.reports_to_id,\n salesforce_user.user_name as contact_owner_name,\n account.account_name,\n account.account_number,\n account.account_source,\n account.annual_revenue as account_annual_revenue,\n account.account_description,\n account.industry as account_industry,\n account.is_deleted as account_is_deleted,\n account.number_of_employees as account_number_of_employees,\n account.owner_id as account_owner_id,\n account.parent_id as account_parent_id,\n account.rating as account_rating,\n account.type as account_type\n\n --The below scripts allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\nfrom contact\nleft join account \n on contact.account_id = account.account_id\nleft join salesforce_user\n on contact.owner_id = salesforce_user.user_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__daily_activity": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__daily_activity", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__daily_activity.sql", "original_file_path": "models/salesforce/salesforce__daily_activity.sql", "unique_id": "model.salesforce.salesforce__daily_activity", "fqn": ["salesforce", "salesforce", "salesforce__daily_activity"], "alias": "salesforce__daily_activity", "checksum": {"name": "sha256", "checksum": "271440ed0f5c882379ea7019ab3714577e8dfdfa93a53b362b6e360ed3c8b930"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a daily summary of the number of sales activities, for example tasks and opportunities closed.", "columns": {"date_day": {"name": "date_day", "description": "Day of event, in UTC.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "leads_created": {"name": "leads_created", "description": "Number of leads created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "leads_converted": {"name": "leads_converted", "description": "Number of leads converted on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tasks_completed": {"name": "tasks_completed", "description": "Number of tasks for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "events_completed": {"name": "events_completed", "description": "Number of events for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_created": {"name": "opportunities_created", "description": "Number of opportunities created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_won": {"name": "opportunities_won", "description": "Number of opportunities won on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_lost": {"name": "opportunities_lost", "description": "Number of opportunities lost on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_created_amount": {"name": "opportunities_created_amount", "description": "The dollar amount of all opportunities created for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_won_amount": {"name": "opportunities_won_amount", "description": "The dollar amount of all opportunities won for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_lost_amount": {"name": "opportunities_lost_amount", "description": "The dollar amount of all opportunities lost for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_amount": {"name": "pipeline_amount", "description": "The dollar amount of all opportunities in the pipeline for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.7888482, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__daily_activity\"", "raw_code": "with date_spine as (\n \n select \n {{ dbt.date_trunc('day', 'date_day') }} as date_day\n from {{ ref('int_salesforce__date_spine') }}\n),\n\n{% if var('salesforce__task_enabled', True) %}\ntask as (\n \n select \n {{ dbt.date_trunc('day', 'activity_date') }} as activity_date,\n count(task_id) as tasks_completed\n from {{ var('task') }}\n group by 1\n), \n{% endif %}\n\n{% if var('salesforce__event_enabled', True) %}\nsalesforce_event as (\n\n select \n coalesce({{ dbt.date_trunc('day', 'activity_date') }}, {{ dbt.date_trunc('day', 'activity_date_time') }}) as activity_date,\n count(event_id) as events_completed\n from {{ var('event') }}\n group by 1\n), \n{% endif %}\n\n{% if var('salesforce__lead_enabled', True) %}\nsalesforce_lead as (\n\n select \n {{ dbt.date_trunc('day', 'created_date') }} as created_date,\n count(lead_id) as leads_created \n from {{ var('lead') }}\n group by 1\n), \n\nsalesforce_converted_lead as (\n\n select \n {{ dbt.date_trunc('day', 'converted_date') }} as converted_date,\n count(lead_id) as leads_converted\n from {{ var('lead') }}\n where is_converted\n group by 1\n), \n{% endif %}\n\nopportunity as (\n\n select \n opportunity_id,\n {{ dbt.date_trunc('day', 'created_date') }} as created_date,\n account_id,\n {{ dbt.date_trunc('day', 'close_date') }} as close_date,\n is_closed,\n is_deleted,\n is_won,\n owner_id, \n stage_name,\n type,\n amount,\n case\n when is_won then 'Won'\n when not is_won and is_closed then 'Lost'\n when not is_closed and lower(forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status\n from {{ var('opportunity') }}\n),\n\nopportunities_created as (\n\n select\n created_date,\n count(opportunity_id) as opportunities_created,\n round(sum(amount)) as opportunities_created_amount\n from opportunity\n group by 1\n),\n\nopportunities_closed as (\n\n select\n close_date,\n count(case when status = 'Won' then opportunity_id else null end) as opportunities_won,\n round(sum(case when status = 'Won' then amount else 0 end)) as opportunities_won_amount,\n count(case when status = 'Lost' then opportunity_id else null end) as opportunities_lost,\n round(sum(case when status = 'Lost' then amount else null end)) as opportunities_lost_amount,\n round(sum(case when status = 'Pipeline' then amount else null end)) as pipeline_amount\n from opportunity\n group by 1\n)\n\nselect\n date_spine.date_day,\n\n {% if var('salesforce__lead_enabled', True) %}\n salesforce_lead.leads_created,\n salesforce_converted_lead.leads_converted,\n {% endif %}\n \n {% if var('salesforce__task_enabled', True) %}\n task.tasks_completed,\n {% endif %}\n\n {% if var('salesforce__event_enabled', True) %}\n salesforce_event.events_completed,\n {% endif %}\n\n opportunities_created.opportunities_created,\n opportunities_created.opportunities_created_amount,\n opportunities_closed.opportunities_won,\n opportunities_closed.opportunities_won_amount,\n opportunities_closed.opportunities_lost,\n opportunities_closed.opportunities_lost_amount,\n opportunities_closed.pipeline_amount\nfrom date_spine\n\n{% if var('salesforce__lead_enabled', True) %}\nleft join salesforce_lead\n on date_spine.date_day = salesforce_lead.created_date\nleft join salesforce_converted_lead\n on date_spine.date_day = salesforce_converted_lead.converted_date\n{% endif %}\n\n{% if var('salesforce__task_enabled', True) %}\nleft join task\n on date_spine.date_day = task.activity_date\n{% endif %}\n\n{% if var('salesforce__event_enabled', True) %}\nleft join salesforce_event\n on date_spine.date_day = salesforce_event.activity_date\n{% endif %}\n\nleft join opportunities_created\n on date_spine.date_day = opportunities_created.created_date\nleft join opportunities_closed\n on date_spine.date_day = opportunities_closed.close_date", "language": "sql", "refs": [{"name": "int_salesforce__date_spine", "package": null, "version": null}, {"name": "stg_salesforce__task", "package": null, "version": null}, {"name": "stg_salesforce__event", "package": null, "version": null}, {"name": "stg_salesforce__lead", "package": null, "version": null}, {"name": "stg_salesforce__lead", "package": null, "version": null}, {"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.salesforce.int_salesforce__date_spine", "model.salesforce_source.stg_salesforce__task", "model.salesforce_source.stg_salesforce__event", "model.salesforce_source.stg_salesforce__lead", "model.salesforce_source.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__daily_activity.sql", "compiled": true, "compiled_code": "with date_spine as (\n \n select \n date_trunc('day', date_day) as date_day\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__date_spine\"\n),\n\n\ntask as (\n \n select \n date_trunc('day', activity_date) as activity_date,\n count(task_id) as tasks_completed\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"\n group by 1\n), \n\n\n\nsalesforce_event as (\n\n select \n coalesce(date_trunc('day', activity_date), date_trunc('day', activity_date_time)) as activity_date,\n count(event_id) as events_completed\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\"\n group by 1\n), \n\n\n\nsalesforce_lead as (\n\n select \n date_trunc('day', created_date) as created_date,\n count(lead_id) as leads_created \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\n group by 1\n), \n\nsalesforce_converted_lead as (\n\n select \n date_trunc('day', converted_date) as converted_date,\n count(lead_id) as leads_converted\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\n where is_converted\n group by 1\n), \n\n\nopportunity as (\n\n select \n opportunity_id,\n date_trunc('day', created_date) as created_date,\n account_id,\n date_trunc('day', close_date) as close_date,\n is_closed,\n is_deleted,\n is_won,\n owner_id, \n stage_name,\n type,\n amount,\n case\n when is_won then 'Won'\n when not is_won and is_closed then 'Lost'\n when not is_closed and lower(forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\n),\n\nopportunities_created as (\n\n select\n created_date,\n count(opportunity_id) as opportunities_created,\n round(sum(amount)) as opportunities_created_amount\n from opportunity\n group by 1\n),\n\nopportunities_closed as (\n\n select\n close_date,\n count(case when status = 'Won' then opportunity_id else null end) as opportunities_won,\n round(sum(case when status = 'Won' then amount else 0 end)) as opportunities_won_amount,\n count(case when status = 'Lost' then opportunity_id else null end) as opportunities_lost,\n round(sum(case when status = 'Lost' then amount else null end)) as opportunities_lost_amount,\n round(sum(case when status = 'Pipeline' then amount else null end)) as pipeline_amount\n from opportunity\n group by 1\n)\n\nselect\n date_spine.date_day,\n\n \n salesforce_lead.leads_created,\n salesforce_converted_lead.leads_converted,\n \n \n \n task.tasks_completed,\n \n\n \n salesforce_event.events_completed,\n \n\n opportunities_created.opportunities_created,\n opportunities_created.opportunities_created_amount,\n opportunities_closed.opportunities_won,\n opportunities_closed.opportunities_won_amount,\n opportunities_closed.opportunities_lost,\n opportunities_closed.opportunities_lost_amount,\n opportunities_closed.pipeline_amount\nfrom date_spine\n\n\nleft join salesforce_lead\n on date_spine.date_day = salesforce_lead.created_date\nleft join salesforce_converted_lead\n on date_spine.date_day = salesforce_converted_lead.converted_date\n\n\n\nleft join task\n on date_spine.date_day = task.activity_date\n\n\n\nleft join salesforce_event\n on date_spine.date_day = salesforce_event.activity_date\n\n\nleft join opportunities_created\n on date_spine.date_day = opportunities_created.created_date\nleft join opportunities_closed\n on date_spine.date_day = opportunities_closed.close_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__manager_performance": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "salesforce__manager_performance", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__manager_performance.sql", "original_file_path": "models/salesforce/salesforce__manager_performance.sql", "unique_id": "model.salesforce.salesforce__manager_performance", "fqn": ["salesforce", "salesforce", "salesforce__manager_performance"], "alias": "salesforce__manager_performance", "checksum": {"name": "sha256", "checksum": "6f0d9523b9b4511b8026510e3d837bfe7468c1981b95e61ded9c3f53bc309768"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a manager, enriched with data about their team's pipeline, bookings, loses, and win percentages.", "columns": {"manager_id": {"name": "manager_id", "description": "The user id of the manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "description": "The opportunity amount, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "description": "The opportunity amount, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "description": "The opportunity count, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "description": "The opportunity count, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "description": "The largest amount associated with a single opportunity in the current pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_month": {"name": "lost_amount_this_month", "description": "The opportunity amount, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_month": {"name": "lost_count_this_month", "description": "The opportunity count, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_quarter": {"name": "lost_count_this_quarter", "description": "The opportunity count, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_city": {"name": "manager_city", "description": "The city location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_name": {"name": "manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_position": {"name": "manager_position", "description": "The position role of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_state": {"name": "manager_state", "description": "The state location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_direct_reports": {"name": "number_of_direct_reports", "description": "The number of opportunity owners who report to this manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "description": "The opportunity count, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "description": "The opportunity count, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "description": "The opportunity amount, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "description": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_win_percent": {"name": "total_win_percent", "description": "The booking amount closed, divided by the sum of the booking amount and the lost amount..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_month": {"name": "win_percent_this_month", "description": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_quarter": {"name": "win_percent_this_quarter", "description": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.773997, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__manager_performance\"", "raw_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from {{ ref('int_salesforce__opportunity_aggregation_by_owner') }}\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n{% if var('salesforce__user_role_enabled', True) %}\nuser_role as (\n\n select *\n from {{ var('user_role') }}\n),\n{% endif %}\n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n)\n\nselect \n coalesce(manager.user_id, 'No Manager Assigned') as manager_id,\n coalesce(manager.user_name, 'No Manager Assigned') as manager_name,\n manager.city as manager_city,\n manager.state as manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n user_role.user_role_name as manager_position,\n {% endif %}\n\n count(distinct owner_id) as number_of_direct_reports,\n coalesce(sum(bookings_amount_closed_this_month), 0) as bookings_amount_closed_this_month,\n coalesce(sum(bookings_amount_closed_this_quarter), 0) as bookings_amount_closed_this_quarter,\n coalesce(sum(total_number_bookings), 0) as total_number_bookings,\n coalesce(sum(total_bookings_amount), 0) as total_bookings_amount,\n coalesce(sum(bookings_count_closed_this_month), 0) as bookings_count_closed_this_month,\n coalesce(sum(bookings_count_closed_this_quarter), 0) as bookings_count_closed_this_quarter,\n coalesce(max(largest_booking), 0) as largest_booking,\n coalesce(sum(lost_amount_this_month), 0) as lost_amount_this_month,\n coalesce(sum(lost_amount_this_quarter), 0) as lost_amount_this_quarter,\n coalesce(sum(total_number_lost), 0) as total_number_lost,\n coalesce(sum(total_lost_amount), 0) as total_lost_amount,\n coalesce(sum(lost_count_this_month), 0) as lost_count_this_month,\n coalesce(sum(lost_count_this_quarter), 0) as lost_count_this_quarter,\n coalesce(sum(pipeline_created_amount_this_month), 0) as pipeline_created_amount_this_month,\n coalesce(sum(pipeline_created_amount_this_quarter), 0) as pipeline_created_amount_this_quarter,\n coalesce(sum(pipeline_created_forecast_amount_this_month), 0) as pipeline_created_forecast_amount_this_month,\n coalesce(sum(pipeline_created_forecast_amount_this_quarter), 0) as pipeline_created_forecast_amount_this_quarter,\n coalesce(sum(pipeline_count_created_this_month), 0) as pipeline_count_created_this_month,\n coalesce(sum(pipeline_count_created_this_quarter), 0) as pipeline_count_created_this_quarter,\n coalesce(sum(total_number_pipeline), 0) as total_number_pipeline,\n coalesce(sum(total_pipeline_amount), 0) as total_pipeline_amount,\n coalesce(sum(total_pipeline_forecast_amount), 0) as total_pipeline_forecast_amount,\n coalesce(max(largest_deal_in_pipeline), 0) as largest_deal_in_pipeline,\n round(case \n when sum(bookings_amount_closed_this_month + lost_amount_this_month) > 0 then\n sum(bookings_amount_closed_this_month) / sum(bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0\n end, 2) as win_percent_this_month,\n round(case\n when sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 then\n sum(bookings_amount_closed_this_quarter) / sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0\n end, 2) as win_percent_this_quarter,\n round(case\n when sum(total_bookings_amount + total_lost_amount) > 0 then\n sum(total_bookings_amount) / sum(total_bookings_amount + total_lost_amount) * 100\n else 0\n end, 2) as total_win_percent\n\nfrom opportunity_aggregation_by_owner\nleft join salesforce_user as manager\n on manager.user_id = opportunity_aggregation_by_owner.manager_id\n\n-- If using user_role table, the following will be included, otherwise it will not.\n{% if var('salesforce__user_role_enabled', True) %}\nleft join user_role\n on manager.user_role_id = user_role.user_role_id\n\ngroup by 1, 2, 3, 4, 5\n\n{% else %}\ngroup by 1, 2, 3, 4\n\n{% endif %}\n\nhaving count(distinct owner_id) > 0", "language": "sql", "refs": [{"name": "int_salesforce__opportunity_aggregation_by_owner", "package": null, "version": null}, {"name": "stg_salesforce__user_role", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user_role", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__manager_performance.sql", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\n),\n\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n)\n\nselect \n coalesce(manager.user_id, 'No Manager Assigned') as manager_id,\n coalesce(manager.user_name, 'No Manager Assigned') as manager_name,\n manager.city as manager_city,\n manager.state as manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as manager_position,\n \n\n count(distinct owner_id) as number_of_direct_reports,\n coalesce(sum(bookings_amount_closed_this_month), 0) as bookings_amount_closed_this_month,\n coalesce(sum(bookings_amount_closed_this_quarter), 0) as bookings_amount_closed_this_quarter,\n coalesce(sum(total_number_bookings), 0) as total_number_bookings,\n coalesce(sum(total_bookings_amount), 0) as total_bookings_amount,\n coalesce(sum(bookings_count_closed_this_month), 0) as bookings_count_closed_this_month,\n coalesce(sum(bookings_count_closed_this_quarter), 0) as bookings_count_closed_this_quarter,\n coalesce(max(largest_booking), 0) as largest_booking,\n coalesce(sum(lost_amount_this_month), 0) as lost_amount_this_month,\n coalesce(sum(lost_amount_this_quarter), 0) as lost_amount_this_quarter,\n coalesce(sum(total_number_lost), 0) as total_number_lost,\n coalesce(sum(total_lost_amount), 0) as total_lost_amount,\n coalesce(sum(lost_count_this_month), 0) as lost_count_this_month,\n coalesce(sum(lost_count_this_quarter), 0) as lost_count_this_quarter,\n coalesce(sum(pipeline_created_amount_this_month), 0) as pipeline_created_amount_this_month,\n coalesce(sum(pipeline_created_amount_this_quarter), 0) as pipeline_created_amount_this_quarter,\n coalesce(sum(pipeline_created_forecast_amount_this_month), 0) as pipeline_created_forecast_amount_this_month,\n coalesce(sum(pipeline_created_forecast_amount_this_quarter), 0) as pipeline_created_forecast_amount_this_quarter,\n coalesce(sum(pipeline_count_created_this_month), 0) as pipeline_count_created_this_month,\n coalesce(sum(pipeline_count_created_this_quarter), 0) as pipeline_count_created_this_quarter,\n coalesce(sum(total_number_pipeline), 0) as total_number_pipeline,\n coalesce(sum(total_pipeline_amount), 0) as total_pipeline_amount,\n coalesce(sum(total_pipeline_forecast_amount), 0) as total_pipeline_forecast_amount,\n coalesce(max(largest_deal_in_pipeline), 0) as largest_deal_in_pipeline,\n round(case \n when sum(bookings_amount_closed_this_month + lost_amount_this_month) > 0 then\n sum(bookings_amount_closed_this_month) / sum(bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0\n end, 2) as win_percent_this_month,\n round(case\n when sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 then\n sum(bookings_amount_closed_this_quarter) / sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0\n end, 2) as win_percent_this_quarter,\n round(case\n when sum(total_bookings_amount + total_lost_amount) > 0 then\n sum(total_bookings_amount) / sum(total_bookings_amount + total_lost_amount) * 100\n else 0\n end, 2) as total_win_percent\n\nfrom opportunity_aggregation_by_owner\nleft join salesforce_user as manager\n on manager.user_id = opportunity_aggregation_by_owner.manager_id\n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nleft join user_role\n on manager.user_role_id = user_role.user_role_id\n\ngroup by 1, 2, 3, 4, 5\n\n\n\nhaving count(distinct owner_id) > 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}, "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "int_salesforce__opportunity_aggregation_by_owner", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/intermediate/int_salesforce__opportunity_aggregation_by_owner.sql", "original_file_path": "models/salesforce/intermediate/int_salesforce__opportunity_aggregation_by_owner.sql", "unique_id": "model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "fqn": ["salesforce", "salesforce", "intermediate", "int_salesforce__opportunity_aggregation_by_owner"], "alias": "int_salesforce__opportunity_aggregation_by_owner", "checksum": {"name": "sha256", "checksum": "1e6d96e6ac108cbdcfad6fc0f6281f3fb0bd595389a17b76154e790e92c3295d"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.311326, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\"", "raw_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from {{ ref('salesforce__opportunity_enhanced') }}\n), \n\nsalesforce_user as (\n\n select * \n from {{ var('user') }}\n), \n\nbooking_by_owner as (\n\n select \n opportunity_manager_id as b_manager_id,\n opportunity_owner_id as b_owner_id,\n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n group by 1, 2\n), \n\nlost_by_owner as (\n\n select \n opportunity_manager_id as l_manager_id,\n opportunity_owner_id as l_owner_id,\n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n group by 1, 2\n), \n\npipeline_by_owner as (\n\n select \n opportunity_manager_id as p_manager_id,\n opportunity_owner_id as p_owner_id,\n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n group by 1, 2\n)\n\nselect \n salesforce_user.user_id as owner_id,\n coalesce(p_manager_id, b_manager_id, l_manager_id) as manager_id,\n booking_by_owner.*,\n lost_by_owner.*,\n pipeline_by_owner.*\nfrom salesforce_user\nleft join booking_by_owner \n on booking_by_owner.b_owner_id = salesforce_user.user_id\nleft join lost_by_owner \n on lost_by_owner.l_owner_id = salesforce_user.user_id\nleft join pipeline_by_owner \n on pipeline_by_owner.p_owner_id = salesforce_user.user_id", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/intermediate/int_salesforce__opportunity_aggregation_by_owner.sql", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\nsalesforce_user as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n), \n\nbooking_by_owner as (\n\n select \n opportunity_manager_id as b_manager_id,\n opportunity_owner_id as b_owner_id,\n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n group by 1, 2\n), \n\nlost_by_owner as (\n\n select \n opportunity_manager_id as l_manager_id,\n opportunity_owner_id as l_owner_id,\n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n group by 1, 2\n), \n\npipeline_by_owner as (\n\n select \n opportunity_manager_id as p_manager_id,\n opportunity_owner_id as p_owner_id,\n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n group by 1, 2\n)\n\nselect \n salesforce_user.user_id as owner_id,\n coalesce(p_manager_id, b_manager_id, l_manager_id) as manager_id,\n booking_by_owner.*,\n lost_by_owner.*,\n pipeline_by_owner.*\nfrom salesforce_user\nleft join booking_by_owner \n on booking_by_owner.b_owner_id = salesforce_user.user_id\nleft join lost_by_owner \n on lost_by_owner.l_owner_id = salesforce_user.user_id\nleft join pipeline_by_owner \n on pipeline_by_owner.p_owner_id = salesforce_user.user_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.int_salesforce__date_spine": {"database": "postgres", "schema": "zz_dbt_catherine_sf_salesforce_dev", "name": "int_salesforce__date_spine", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/intermediate/int_salesforce__date_spine.sql", "original_file_path": "models/salesforce/intermediate/int_salesforce__date_spine.sql", "unique_id": "model.salesforce.int_salesforce__date_spine", "fqn": ["salesforce", "salesforce", "intermediate", "int_salesforce__date_spine"], "alias": "int_salesforce__date_spine", "checksum": {"name": "sha256", "checksum": "523937fa6f553c52b433218f4bd4c350fcf2ba6cef6ea320ab54b1085cd0b985"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1720572444.314999, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__date_spine\"", "raw_code": "with spine as (\n\n {% if execute %}\n\n {%- set first_date_query %}\n select \n coalesce(\n min(cast(created_date as date)), \n cast({{ dbt.dateadd(\"month\", -1, \"current_date\") }} as date)\n ) as min_date\n {% if var('salesforce__lead_enabled', True) %}\n from {{ source('salesforce', 'lead') }}\n {% else %}\n from {{ source('salesforce', 'opportunity') }}\n {% endif %} \n {% endset -%}\n\n {%- set first_date = dbt_utils.get_single_value(first_date_query) %}\n\n {% set last_date_query %}\n select \n coalesce(\n greatest(max(cast(created_date as date)), cast(current_date as date)),\n cast(current_date as date)\n ) as max_date\n {% if var('salesforce__lead_enabled', True) %}\n from {{ source('salesforce', 'lead') }}\n {% else %}\n from {{ source('salesforce', 'opportunity') }}\n {% endif %} \n {% endset -%}\n\n {%- set last_date = dbt_utils.get_single_value(last_date_query) %}\n\n {% else %}\n\n {% set first_date = 'dbt.dateadd(\"month\", -1, \"current_date\")' %}\n {% set last_date = 'dbt.current_timestamp_backcompat()' %}\n\n {% endif %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date=\"cast('\" ~ first_date ~ \"' as date)\",\n end_date=dbt.dateadd(\"day\", 1, \"cast('\" ~ last_date ~ \"' as date)\")\n )\n }}\n)\n\nselect * \nfrom spine", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt_utils.get_single_value"], "nodes": []}, "compiled_path": "target/compiled/salesforce/models/salesforce/intermediate/int_salesforce__date_spine.sql", "compiled": true, "compiled_code": "with spine as (\n\n \n\n \n\n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1704\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2019-11-11' as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= \n\n cast('2024-07-10' as date) + ((interval '1 day') * (1))\n\n\n\n)\n\nselect * from filtered\n\n\n)\n\nselect * \nfrom spine", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__opportunity_history": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__opportunity_history", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce_history/stg_salesforce__opportunity_history.sql", "original_file_path": "models/salesforce_history/stg_salesforce__opportunity_history.sql", "unique_id": "model.salesforce_source.stg_salesforce__opportunity_history", "fqn": ["salesforce_source", "salesforce_history", "stg_salesforce__opportunity_history"], "alias": "stg_salesforce__opportunity_history", "checksum": {"name": "sha256", "checksum": "cedc11f02f20dbf84230c35bffecadd658b05c6e7bec647507865b762661e6d7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "history_unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Represents historical records of opportunities, which are sales or pending deals.", "columns": {"opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_date": {"name": "_fivetran_date", "description": "The date when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce_history/stg_salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "unique_key": "history_unique_key", "incremental_strategy": "delete+insert", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet", "on_schema_change": "fail"}, "created_at": 1720572444.846393, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"", "raw_code": "{{ config(\n enabled=var('salesforce__opportunity_history_enabled', False),\n materialized='incremental',\n unique_key='history_unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\n \"field\": \"_fivetran_date\", \n \"data_type\": \"date\"\n } if target.type not in ('spark','databricks') else ['_fivetran_date'],\n file_format='parquet',\n on_schema_change='fail'\n ) \n}}\n\nwith base as (\n\n select * \n from {{ source('salesforce_history','opportunity') }}\n {% if is_incremental() %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% else %}\n {% if var('global_history_start_date',[]) or var('opportunity_history_start_date',[]) %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= \n {% if var('opportunity_history_start_date', []) %}\n \"{{ var('opportunity_history_start_date') }}\"\n {% else %}\n \"{{ var('global_history_start_date') }}\"\n {% endif %}\n {% endif %}\n {% endif %} \n),\n\nfinal as (\n\n select \n id as opportunity_id,\n cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start,\n cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key,\n\n {{ dbt_utils.star(from=source('salesforce_history','opportunity'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n from base\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce_history", "opportunity"], ["salesforce_history", "opportunity"]], "metrics": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce_source.salesforce_history.opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce__opportunity_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\" )\n \n),\n\nfinal as (\n\n select \n id as opportunity_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"amount\",\n \"campaign_id\",\n \"close_date\",\n \"created_date\",\n \"description\",\n \"expected_revenue\",\n \"fiscal\",\n \"fiscal_quarter\",\n \"fiscal_year\",\n \"forecast_category\",\n \"forecast_category_name\",\n \"has_open_activity\",\n \"has_opportunity_line_item\",\n \"has_overdue_task\",\n \"is_closed\",\n \"is_deleted\",\n \"is_won\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"lead_source\",\n \"name\",\n \"next_step\",\n \"owner_id\",\n \"probability\",\n \"record_type_id\",\n \"stage_name\",\n \"synced_quote_id\",\n \"type\"\n from base\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}, "model.salesforce_source.stg_salesforce__account_history": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__account_history", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce_history/stg_salesforce__account_history.sql", "original_file_path": "models/salesforce_history/stg_salesforce__account_history.sql", "unique_id": "model.salesforce_source.stg_salesforce__account_history", "fqn": ["salesforce_source", "salesforce_history", "stg_salesforce__account_history"], "alias": "stg_salesforce__account_history", "checksum": {"name": "sha256", "checksum": "dcce3ab61cac84fa621d4e07fb13c7c8138fa506832c326d31f0eef29d2d8492"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "history_unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Represents historical records of individual accounts, which are organizations or people involved with your business (such as customers, competitors, and partners).", "columns": {"account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_date": {"name": "_fivetran_date", "description": "The date when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce_history/stg_salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "unique_key": "history_unique_key", "incremental_strategy": "delete+insert", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet", "on_schema_change": "fail"}, "created_at": 1720572444.844206, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"", "raw_code": "{{ config(\n enabled= var('salesforce__account_history_enabled', False),\n materialized='incremental',\n unique_key='history_unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\n \"field\": \"_fivetran_date\", \n \"data_type\": \"date\"\n } if target.type not in ('spark','databricks') else ['_fivetran_date'],\n file_format='parquet',\n on_schema_change='fail'\n )\n}}\n\nwith base as (\n\n select * \n from {{ source('salesforce_history', 'account') }}\n {% if is_incremental() %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% else %}\n {% if var('global_history_start_date',[]) or var('account_history_start_date',[]) %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= \n {% if var('account_history_start_date', []) %}\n \"{{ var('account_history_start_date') }}\"\n {% else %}\n \"{{ var('global_history_start_date') }}\"\n {% endif %}\n {% endif %}\n {% endif %} \n),\n\nfinal as (\n\n select \n id as account_id,\n cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start,\n cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key,\n\n {{ dbt_utils.star(from=source('salesforce_history','account'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n from base\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce_history", "account"], ["salesforce_history", "account"]], "metrics": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce_source.salesforce_history.account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce__account_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\" )\n \n),\n\nfinal as (\n\n select \n id as account_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_number\",\n \"account_source\",\n \"annual_revenue\",\n \"billing_city\",\n \"billing_country\",\n \"billing_postal_code\",\n \"billing_state\",\n \"billing_street\",\n \"description\",\n \"industry\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"master_record_id\",\n \"name\",\n \"number_of_employees\",\n \"owner_id\",\n \"ownership\",\n \"parent_id\",\n \"rating\",\n \"record_type_id\",\n \"shipping_city\",\n \"shipping_country\",\n \"shipping_postal_code\",\n \"shipping_state\",\n \"shipping_street\",\n \"type\",\n \"website\"\n from base\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}, "model.salesforce_source.stg_salesforce__contact_history": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__contact_history", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce_history/stg_salesforce__contact_history.sql", "original_file_path": "models/salesforce_history/stg_salesforce__contact_history.sql", "unique_id": "model.salesforce_source.stg_salesforce__contact_history", "fqn": ["salesforce_source", "salesforce_history", "stg_salesforce__contact_history"], "alias": "stg_salesforce__contact_history", "checksum": {"name": "sha256", "checksum": "4c54e59e30090bd2518713a07ac527dac8730b36111e56f7894154e3c1dcadb8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "history_unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Represents the historical record of contacts, which are people associated with an account.", "columns": {"contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_date": {"name": "_fivetran_date", "description": "The date when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce_history/stg_salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "unique_key": "history_unique_key", "incremental_strategy": "delete+insert", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet", "on_schema_change": "fail"}, "created_at": 1720572444.845261, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"", "raw_code": "{{ config(\n enabled=var('salesforce__contact_history_enabled', False),\n materialized='incremental',\n unique_key='history_unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\n \"field\": \"_fivetran_date\", \n \"data_type\": \"date\"\n } if target.type not in ('spark','databricks') else ['_fivetran_date'],\n file_format='parquet',\n on_schema_change='fail'\n ) \n}}\n\nwith base as (\n\n select * \n from {{ source('salesforce_history', 'contact') }}\n {% if is_incremental() %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% else %}\n {% if var('global_history_start_date',[]) or var('contact_history_start_date',[]) %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= \n {% if var('contact_history_start_date', []) %}\n \"{{ var('contact_history_start_date') }}\"\n {% else %}\n \"{{ var('global_history_start_date') }}\"\n {% endif %}\n {% endif %}\n {% endif %} \n),\n\nfinal as (\n\n select \n id as contact_id,\n cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start,\n cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key,\n\n {{ dbt_utils.star(from=source('salesforce_history','contact'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n from base\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce_history", "contact"], ["salesforce_history", "contact"]], "metrics": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce_source.salesforce_history.contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce__contact_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\" )\n \n),\n\nfinal as (\n\n select \n id as contact_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"email\",\n \"first_name\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_modified_by_id\",\n \"last_modified_date\",\n \"last_name\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"mailing_city\",\n \"mailing_country\",\n \"mailing_country_code\",\n \"mailing_postal_code\",\n \"mailing_state\",\n \"mailing_street\",\n \"master_record_id\",\n \"mobile_phone\",\n \"name\",\n \"owner_id\",\n \"phone\",\n \"reports_to_id\",\n \"title\",\n \"lead_source\",\n \"description\",\n \"individual_id\",\n \"home_phone\"\n from base\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}, "model.salesforce_source.stg_salesforce__opportunity": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__opportunity", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__opportunity.sql", "original_file_path": "models/salesforce/stg_salesforce__opportunity.sql", "unique_id": "model.salesforce_source.stg_salesforce__opportunity", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__opportunity"], "alias": "stg_salesforce__opportunity", "checksum": {"name": "sha256", "checksum": "90a89ad6ce124dc98f631428d608b7a4e35debbde1744d1a2da8e54caf1214a7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an opportunity, which is a sale or pending deal.", "columns": {"opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close. The Close Date will change as you work the sale. It should never be set in stone as it affects your sales pipeline, and it should never be in the past.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_excluded_from_territory_2_filter": {"name": "is_excluded_from_territory_2_filter", "description": "Used for Filter-Based Opportunity Territory Assignment. Indicates whether the opportunity is excluded (True) or included (False) each time the APEX filter is executed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "Pricebook2Id": {"name": "Pricebook2Id", "description": "ID of a related Pricebook2 object. The Pricebook2Id field indicates which Pricebook2 applies to this opportunity. The Pricebook2Id field is defined only for those organizations that have products enabled as a feature. You can specify values for only one field (Pricebook2Id or PricebookId)\u2014not both fields. For this reason, both fields are declared nillable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Unavailable as of version 3.0. As of version 8.0, the Pricebook object is no longer available. Use the Pricebook2Id field instead, specifying the ID of the Pricebook2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "territory_2_id": {"name": "territory_2_id", "description": "The ID of the territory that is assigned to the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_month": {"name": "is_created_this_month", "description": "Yes, if the opportunity created date is in the current month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_quarter": {"name": "is_created_this_quarter", "description": "Yes, if the opportunity created date is in the current quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_since_created": {"name": "days_since_created", "description": "The difference, in days, between the opportunity created date and the current timestamp.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_close": {"name": "days_to_close", "description": "The difference, in days, between the opportunity created date and the opportunity close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_month": {"name": "is_closed_this_month", "description": "Yes, if the opportunity close date is in the current month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_quarter": {"name": "is_closed_this_quarter", "description": "Yes, if the opportunity close date is in the current quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table"}, "created_at": 1720572444.921321, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"", "raw_code": "{% set opportunity_column_list = get_opportunity_columns() -%}\n{% set opportunity_dict = column_list_to_dict(opportunity_column_list) -%}\n\nwith fields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','opportunity')),\n staging_columns=opportunity_column_list\n )\n }}\n\n from {{ source('salesforce','opportunity') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"account_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"amount\", opportunity_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"campaign_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"close_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", opportunity_dict, alias=\"opportunity_description\") }},\n {{ salesforce_source.coalesce_rename(\"expected_revenue\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"fiscal\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"fiscal_quarter\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"fiscal_year\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"forecast_category\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"forecast_category_name\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_open_activity\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_opportunity_line_item\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_overdue_task\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"id\", opportunity_dict, alias=\"opportunity_id\") }},\n {{ salesforce_source.coalesce_rename(\"is_closed\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_won\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"lead_source\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", opportunity_dict, alias=\"opportunity_name\") }},\n {{ salesforce_source.coalesce_rename(\"next_step\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"probability\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"stage_name\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"synced_quote_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", opportunity_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__opportunity_pass_through_columns') }}\n\n from fields\n where coalesce(_fivetran_active, true)\n), \n\ncalculated as (\n \n select \n *,\n created_date >= {{ dbt.date_trunc('month', dbt.current_timestamp_backcompat()) }} as is_created_this_month,\n created_date >= {{ dbt.date_trunc('quarter', dbt.current_timestamp_backcompat()) }} as is_created_this_quarter,\n {{ dbt.datediff(dbt.current_timestamp_backcompat(), 'created_date', 'day') }} as days_since_created,\n {{ dbt.datediff('close_date', 'created_date', 'day') }} as days_to_close,\n {{ dbt.date_trunc('month', 'close_date') }} = {{ dbt.date_trunc('month', dbt.current_timestamp_backcompat()) }} as is_closed_this_month,\n {{ dbt.date_trunc('quarter', 'close_date') }} = {{ dbt.date_trunc('quarter', dbt.current_timestamp_backcompat()) }} as is_closed_this_quarter\n from final\n)\n\nselect * \nfrom calculated\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "opportunity"], ["salesforce", "opportunity"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_opportunity_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.datediff"], "nodes": ["source.salesforce_source.salesforce.opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__opportunity.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n close_date\n \n as \n \n close_date\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n expected_revenue\n \n as \n \n expected_revenue\n \n, \n \n \n fiscal\n \n as \n \n fiscal\n \n, \n \n \n fiscal_quarter\n \n as \n \n fiscal_quarter\n \n, \n \n \n fiscal_year\n \n as \n \n fiscal_year\n \n, \n \n \n forecast_category\n \n as \n \n forecast_category\n \n, \n \n \n forecast_category_name\n \n as \n \n forecast_category_name\n \n, \n \n \n has_open_activity\n \n as \n \n has_open_activity\n \n, \n \n \n has_opportunity_line_item\n \n as \n \n has_opportunity_line_item\n \n, \n \n \n has_overdue_task\n \n as \n \n has_overdue_task\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_won\n \n as \n \n is_won\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n next_step\n \n as \n \n next_step\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n probability\n \n as \n \n probability\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n stage_name\n \n as \n \n stage_name\n \n, \n \n \n synced_quote_id\n \n as \n \n synced_quote_id\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CampaignId\n \n , \n cast(null as timestamp) as \n \n CloseDate\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as numeric(28,6)) as \n \n ExpectedRevenue\n \n , \n cast(null as integer) as \n \n FiscalQuarter\n \n , \n cast(null as integer) as \n \n FiscalYear\n \n , \n cast(null as TEXT) as \n \n ForecastCategory\n \n , \n cast(null as TEXT) as \n \n ForecastCategoryName\n \n , \n cast(null as boolean) as \n \n HasOpenActivity\n \n , \n cast(null as boolean) as \n \n HasOpportunityLineItem\n \n , \n cast(null as boolean) as \n \n HasOverdueTask\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsWon\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n NextStep\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n StageName\n \n , \n cast(null as TEXT) as \n \n SyncedQuoteId\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n cast(Amount as numeric(28,6)) as amount,\n \n\n\n coalesce(cast(CampaignId as TEXT),\n cast(campaign_id as TEXT))\n as campaign_id,\n \n\n\n coalesce(cast(CloseDate as timestamp),\n cast(close_date as timestamp))\n as close_date,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as opportunity_description,\n \n\n\n coalesce(cast(ExpectedRevenue as numeric(28,6)),\n cast(expected_revenue as numeric(28,6)))\n as expected_revenue,\n \n\n\n cast(Fiscal as TEXT) as fiscal,\n \n\n\n coalesce(cast(FiscalQuarter as integer),\n cast(fiscal_quarter as integer))\n as fiscal_quarter,\n \n\n\n coalesce(cast(FiscalYear as integer),\n cast(fiscal_year as integer))\n as fiscal_year,\n \n\n\n coalesce(cast(ForecastCategory as TEXT),\n cast(forecast_category as TEXT))\n as forecast_category,\n \n\n\n coalesce(cast(ForecastCategoryName as TEXT),\n cast(forecast_category_name as TEXT))\n as forecast_category_name,\n \n\n\n coalesce(cast(HasOpenActivity as boolean),\n cast(has_open_activity as boolean))\n as has_open_activity,\n \n\n\n coalesce(cast(HasOpportunityLineItem as boolean),\n cast(has_opportunity_line_item as boolean))\n as has_opportunity_line_item,\n \n\n\n coalesce(cast(HasOverdueTask as boolean),\n cast(has_overdue_task as boolean))\n as has_overdue_task,\n \n\n\n cast(Id as TEXT) as opportunity_id,\n \n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsWon as boolean),\n cast(is_won as boolean))\n as is_won,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n cast(Name as TEXT) as opportunity_name,\n \n\n\n coalesce(cast(NextStep as TEXT),\n cast(next_step as TEXT))\n as next_step,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Probability as float) as probability,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n coalesce(cast(StageName as TEXT),\n cast(stage_name as TEXT))\n as stage_name,\n \n\n\n coalesce(cast(SyncedQuoteId as TEXT),\n cast(synced_quote_id as TEXT))\n as synced_quote_id,\n \n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n), \n\ncalculated as (\n \n select \n *,\n created_date >= date_trunc('month', \n current_timestamp::timestamp\n) as is_created_this_month,\n created_date >= date_trunc('quarter', \n current_timestamp::timestamp\n) as is_created_this_quarter,\n \n ((created_date)::date - (\n current_timestamp::timestamp\n)::date)\n as days_since_created,\n \n ((created_date)::date - (close_date)::date)\n as days_to_close,\n date_trunc('month', close_date) = date_trunc('month', \n current_timestamp::timestamp\n) as is_closed_this_month,\n date_trunc('quarter', close_date) = date_trunc('quarter', \n current_timestamp::timestamp\n) as is_closed_this_quarter\n from final\n)\n\nselect * \nfrom calculated\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__user_role": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__user_role", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__user_role.sql", "original_file_path": "models/salesforce/stg_salesforce__user_role.sql", "unique_id": "model.salesforce_source.stg_salesforce__user_role", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__user_role"], "alias": "stg_salesforce__user_role", "checksum": {"name": "sha256", "checksum": "6646446e9a0329fc8f87b561455a791a2dddaade3072b49418794924a82fcee3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a user role in your organization.", "columns": {"user_role_id": {"name": "user_role_id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "case_access_for_account_owner": {"name": "case_access_for_account_owner", "description": "The case access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_access_for_account_owner": {"name": "contact_access_for_account_owner", "description": "The contact access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_user_id": {"name": "forecast_user_id", "description": "The ID of the forecast manager associated with this role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "may_forecast_manager_share": {"name": "may_forecast_manager_share", "description": "Indicates whether the forecast manager can manually share their own forecast.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_role_name": {"name": "user_role_name", "description": "Required. Name of the role. Corresponds to Label on the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_access_for_account_owner": {"name": "opportunity_access_for_account_owner", "description": "Required. The opportunity access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.9319308, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"", "raw_code": "--To disable this model, set the salesforce__user_role_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__user_role_enabled', True)) }}\n\n{% set user_role_column_list = get_user_role_columns() -%}\n{% set user_role_dict = column_list_to_dict(user_role_column_list) -%}\n\nwith fields as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','user_role')),\n staging_columns=user_role_column_list\n )\n }}\n\n from {{ source('salesforce','user_role') }}\n), \n\nfinal as (\n\n select\n _fivetran_deleted,\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"developer_name\", user_role_dict ) }},\n {{ salesforce_source.coalesce_rename(\"id\", user_role_dict, alias=\"user_role_id\") }},\n {{ salesforce_source.coalesce_rename(\"name\", user_role_dict, alias=\"user_role_name\") }},\n {{ salesforce_source.coalesce_rename(\"opportunity_access_for_account_owner\", user_role_dict ) }},\n {{ salesforce_source.coalesce_rename(\"parent_role_id\", user_role_dict ) }},\n {{ salesforce_source.coalesce_rename(\"rollup_description\", user_role_dict ) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__user_role_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce", "user_role"], ["salesforce", "user_role"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_user_role_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.user_role"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__user_role.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__user_role_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n developer_name\n \n as \n \n developer_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_access_for_account_owner\n \n as \n \n opportunity_access_for_account_owner\n \n, \n \n \n parent_role_id\n \n as \n \n parent_role_id\n \n, \n \n \n rollup_description\n \n as \n \n rollup_description\n \n, \n cast(null as TEXT) as \n \n DeveloperName\n \n , \n cast(null as TEXT) as \n \n OpportunityAccessForAccountOwner\n \n , \n cast(null as TEXT) as \n \n ParentRoleId\n \n , \n cast(null as TEXT) as \n \n RollupDescription\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_role_data\"\n), \n\nfinal as (\n\n select\n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(DeveloperName as TEXT),\n cast(developer_name as TEXT))\n as developer_name,\n \n\n\n cast(Id as TEXT) as user_role_id,\n \n\n\n cast(Name as TEXT) as user_role_name,\n \n\n\n coalesce(cast(OpportunityAccessForAccountOwner as TEXT),\n cast(opportunity_access_for_account_owner as TEXT))\n as opportunity_access_for_account_owner,\n \n\n\n coalesce(cast(ParentRoleId as TEXT),\n cast(parent_role_id as TEXT))\n as parent_role_id,\n \n\n\n coalesce(cast(RollupDescription as TEXT),\n cast(rollup_description as TEXT))\n as rollup_description\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, 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}, "model.salesforce_source.stg_salesforce__contact": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__contact", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__contact.sql", "original_file_path": "models/salesforce/stg_salesforce__contact.sql", "unique_id": "model.salesforce_source.stg_salesforce__contact", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__contact"], "alias": "stg_salesforce__contact", "checksum": {"name": "sha256", "checksum": "a30d335ad3c0250a5414ca775330a8ce6ce5a770dc131b1bcb530a420c8049e3"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a contact, which is a person associated with an account.", "columns": {"contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country_code": {"name": "mailing_country_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state_code": {"name": "mailing_state_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table"}, "created_at": 1720572444.93294, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"", "raw_code": "{% set contact_column_list = get_contact_columns() -%}\n{% set contact_dict = column_list_to_dict(contact_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','contact')),\n staging_columns=contact_column_list\n )\n }}\n \n from {{ source('salesforce','contact') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", contact_dict, alias=\"contact_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"department\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", contact_dict, alias=\"contact_description\") }},\n {{ salesforce_source.coalesce_rename(\"email\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"first_name\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"home_phone\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"individual_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_name\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"lead_source\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_city\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_country\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_country_code\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_postal_code\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_state\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_state_code\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_street\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"master_record_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mobile_phone\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", contact_dict, alias=\"contact_name\") }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"phone\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"reports_to_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"title\", contact_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__contact_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "contact"], ["salesforce", "contact"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_contact_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__contact.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n home_phone\n \n as \n \n home_phone\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n mailing_city\n \n as \n \n mailing_city\n \n, \n \n \n mailing_country\n \n as \n \n mailing_country\n \n, \n \n \n mailing_country_code\n \n as \n \n mailing_country_code\n \n, \n \n \n mailing_postal_code\n \n as \n \n mailing_postal_code\n \n, \n \n \n mailing_state\n \n as \n \n mailing_state\n \n, \n \n \n mailing_state_code\n \n as \n \n mailing_state_code\n \n, \n \n \n mailing_street\n \n as \n \n mailing_street\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n reports_to_id\n \n as \n \n reports_to_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n HomePhone\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MailingCity\n \n , \n cast(null as TEXT) as \n \n MailingCountry\n \n , \n cast(null as TEXT) as \n \n MailingCountryCode\n \n , \n cast(null as TEXT) as \n \n MailingPostalCode\n \n , \n cast(null as TEXT) as \n \n MailingState\n \n , \n cast(null as TEXT) as \n \n MailingStateCode\n \n , \n cast(null as TEXT) as \n \n MailingStreet\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ReportsToId\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as contact_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n cast(Department as TEXT) as department,\n \n\n\n cast(Description as TEXT) as contact_description,\n \n\n\n cast(Email as TEXT) as email,\n \n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n coalesce(cast(HomePhone as TEXT),\n cast(home_phone as TEXT))\n as home_phone,\n \n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n coalesce(cast(MailingCity as TEXT),\n cast(mailing_city as TEXT))\n as mailing_city,\n \n\n\n coalesce(cast(MailingCountry as TEXT),\n cast(mailing_country as TEXT))\n as mailing_country,\n \n\n\n coalesce(cast(MailingCountryCode as TEXT),\n cast(mailing_country_code as TEXT))\n as mailing_country_code,\n \n\n\n coalesce(cast(MailingPostalCode as TEXT),\n cast(mailing_postal_code as TEXT))\n as mailing_postal_code,\n \n\n\n coalesce(cast(MailingState as TEXT),\n cast(mailing_state as TEXT))\n as mailing_state,\n \n\n\n coalesce(cast(MailingStateCode as TEXT),\n cast(mailing_state_code as TEXT))\n as mailing_state_code,\n \n\n\n coalesce(cast(MailingStreet as TEXT),\n cast(mailing_street as TEXT))\n as mailing_street,\n \n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n cast(Name as TEXT) as contact_name,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Phone as TEXT) as phone,\n \n\n\n coalesce(cast(ReportsToId as TEXT),\n cast(reports_to_id as TEXT))\n as reports_to_id,\n \n\n\n cast(Title as TEXT) as title\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__account": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__account", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__account.sql", "original_file_path": "models/salesforce/stg_salesforce__account.sql", "unique_id": "model.salesforce_source.stg_salesforce__account", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__account"], "alias": "stg_salesforce__account", "checksum": {"name": "sha256", "checksum": "8fc5b92b78f3f85d3534f826e2d53ed402cbd62966353665d443a9f4753a7d87"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).", "columns": {"account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "The ISO country code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode for the billing address. See Compound Field Considerations and Limitations for details on geolocation compound fields.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_latitude": {"name": "billing_latitude", "description": "Used with BillingLongitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_longitude": {"name": "billing_longitude", "description": "Used with BillingLatitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "The ISO state code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_company_id": {"name": "jigsaw_company_id", "description": "References the ID of a company in Data.com. If an account has a value in this field, it means that the account was imported from Data.com.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "The ISO country code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_latitude": {"name": "shipping_latitude", "description": "Used with ShippingLongitude to specify the precise geolocation of a shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "The ISO state code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic": {"name": "sic", "description": "Standard Industrial Classification code of the company\u2019s main business categorization, for example, 57340 for Electronics.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic_desc": {"name": "sic_desc", "description": "A brief description of an organization\u2019s line of business, based on its SIC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ticker_symbol": {"name": "ticker_symbol", "description": "The stock market symbol for this account. This field is available on business accounts, not person accounts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table"}, "created_at": 1720572444.919507, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"", "raw_code": "{% set account_column_list = get_account_columns() -%}\n{% set account_dict = column_list_to_dict(account_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','account')),\n staging_columns=account_column_list\n )\n }}\n\n from {{ source('salesforce','account') }}\n), \n\nfinal as (\n select\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"account_number\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"account_source\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"annual_revenue\", account_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"billing_city\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_country\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_postal_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_street\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", account_dict, alias=\"account_description\" ) }},\n {{ salesforce_source.coalesce_rename(\"id\", account_dict, alias=\"account_id\") }},\n {{ salesforce_source.coalesce_rename(\"industry\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"master_record_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", account_dict, alias=\"account_name\" ) }},\n {{ salesforce_source.coalesce_rename(\"number_of_employees\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"ownership\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"parent_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"rating\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_city\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_postal_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_street\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"website\", account_dict) }}\n\n {{ fivetran_utils.fill_pass_through_columns('salesforce__account_pass_through_columns') }}\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "account"], ["salesforce", "account"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_account_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__account.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_number\n \n as \n \n account_number\n \n, \n \n \n account_source\n \n as \n \n account_source\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n ownership\n \n as \n \n ownership\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n rating\n \n as \n \n rating\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as TEXT) as \n \n AccountNumber\n \n , \n cast(null as TEXT) as \n \n AccountSource\n \n , \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ParentId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_data\"\n), \n\nfinal as (\n select\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(AccountNumber as TEXT),\n cast(account_number as TEXT))\n as account_number,\n \n\n\n coalesce(cast(AccountSource as TEXT),\n cast(account_source as TEXT))\n as account_source,\n \n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n cast(Description as TEXT) as account_description,\n \n\n\n cast(Id as TEXT) as account_id,\n \n\n\n cast(Industry as TEXT) as industry,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n cast(Name as TEXT) as account_name,\n \n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Ownership as TEXT) as ownership,\n \n\n\n coalesce(cast(ParentId as TEXT),\n cast(parent_id as TEXT))\n as parent_id,\n \n\n\n cast(Rating as TEXT) as rating,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n cast(Type as TEXT) as type,\n \n\n\n cast(Website as TEXT) as website\n\n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__lead": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__lead", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__lead.sql", "original_file_path": "models/salesforce/stg_salesforce__lead.sql", "unique_id": "model.salesforce_source.stg_salesforce__lead", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__lead"], "alias": "stg_salesforce__lead", "checksum": {"name": "sha256", "checksum": "867419072e95b386d8e9eaa44a3ca5eb64ebc18b95268f6f530cea23d4b662cb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a prospect or lead.", "columns": {"lead_id": {"name": "lead_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_account_id": {"name": "converted_account_id", "description": "Object reference ID that points to the account into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_contact_id": {"name": "converted_contact_id", "description": "Object reference ID that points to the contact into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_opportunity_id": {"name": "converted_opportunity_id", "description": "Object reference ID that points to the opportunity into which the lead has been converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_description": {"name": "lead_description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_date": {"name": "email_bounced_date", "description": "If bounce management is activated and an email sent to the lead bounced, the date and time of the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_reason": {"name": "email_bounced_reason", "description": "If bounce management is activated and an email sent to the lead bounced, the reason for the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "Indicates whether the lead doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this lead. This field is available if you enabled Data Protection and Privacy in Setup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_converted": {"name": "is_converted", "description": "Indicates whether the lead has been converted (true) or not (false). Label is Converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_unread_by_owner": {"name": "is_unread_by_owner", "description": "If true, lead has been assigned, but not yet viewed. See Unread Leads for more information. Label is Unread By Owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "'Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.'\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that was kept. If this record was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_name": {"name": "lead_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees at the lead\u2019s company. Label is Employees.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the lead\u2019s owner. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "Postal code for the address of the lead. Label is Zip/Postal Code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status code for this converted lead. Status codes are defined in Status and represented in the API by the LeadStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.940832, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"", "raw_code": "--To disable this model, set the salesforce__lead_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__lead_enabled', True)) }}\n\n{% set lead_column_list = get_lead_columns() -%}\n{% set lead_dict = column_list_to_dict(lead_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','lead')),\n staging_columns=lead_column_list\n )\n }}\n \n from {{ source('salesforce','lead') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", lead_dict, alias=\"lead_id\") }},\n {{ salesforce_source.coalesce_rename(\"annual_revenue\", lead_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"city\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"company\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_account_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_contact_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_opportunity_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"country\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"country_code\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", lead_dict, alias=\"lead_description\") }},\n {{ salesforce_source.coalesce_rename(\"email\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"email_bounced_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"email_bounced_reason\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"first_name\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_opted_out_of_email\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"individual_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"industry\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_converted\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_unread_by_owner\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_name\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"lead_source\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"master_record_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"mobile_phone\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", lead_dict, alias=\"lead_name\") }},\n {{ salesforce_source.coalesce_rename(\"number_of_employees\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"phone\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"postal_code\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"state\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"state_code\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"status\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"street\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"title\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"website\", lead_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__lead_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "lead"], ["salesforce", "lead"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_lead_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.lead"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__lead.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__lead_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company\n \n as \n \n company\n \n, \n \n \n converted_account_id\n \n as \n \n converted_account_id\n \n, \n \n \n converted_contact_id\n \n as \n \n converted_contact_id\n \n, \n \n \n converted_date\n \n as \n \n converted_date\n \n, \n \n \n converted_opportunity_id\n \n as \n \n converted_opportunity_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n email_bounced_date\n \n as \n \n email_bounced_date\n \n, \n \n \n email_bounced_reason\n \n as \n \n email_bounced_reason\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n has_opted_out_of_email\n \n as \n \n has_opted_out_of_email\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_converted\n \n as \n \n is_converted\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_unread_by_owner\n \n as \n \n is_unread_by_owner\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n ConvertedAccountId\n \n , \n cast(null as TEXT) as \n \n ConvertedContactId\n \n , \n cast(null as timestamp) as \n \n ConvertedDate\n \n , \n cast(null as TEXT) as \n \n ConvertedOpportunityId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EmailBouncedDate\n \n , \n cast(null as TEXT) as \n \n EmailBouncedReason\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as boolean) as \n \n HasOptedOutOfEmail\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsConverted\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsUnreadByOwner\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_lead_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as lead_id,\n \n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n cast(City as TEXT) as city,\n \n\n\n cast(Company as TEXT) as company,\n \n\n\n coalesce(cast(ConvertedAccountId as TEXT),\n cast(converted_account_id as TEXT))\n as converted_account_id,\n \n\n\n coalesce(cast(ConvertedContactId as TEXT),\n cast(converted_contact_id as TEXT))\n as converted_contact_id,\n \n\n\n coalesce(cast(ConvertedDate as timestamp),\n cast(converted_date as timestamp))\n as converted_date,\n \n\n\n coalesce(cast(ConvertedOpportunityId as TEXT),\n cast(converted_opportunity_id as TEXT))\n as converted_opportunity_id,\n \n\n\n cast(Country as TEXT) as country,\n \n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as lead_description,\n \n\n\n cast(Email as TEXT) as email,\n \n\n\n coalesce(cast(EmailBouncedDate as timestamp),\n cast(email_bounced_date as timestamp))\n as email_bounced_date,\n \n\n\n coalesce(cast(EmailBouncedReason as TEXT),\n cast(email_bounced_reason as TEXT))\n as email_bounced_reason,\n \n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n coalesce(cast(HasOptedOutOfEmail as boolean),\n cast(has_opted_out_of_email as boolean))\n as has_opted_out_of_email,\n \n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n cast(Industry as TEXT) as industry,\n \n\n\n coalesce(cast(IsConverted as boolean),\n cast(is_converted as boolean))\n as is_converted,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsUnreadByOwner as boolean),\n cast(is_unread_by_owner as boolean))\n as is_unread_by_owner,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n cast(Name as TEXT) as lead_name,\n \n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Phone as TEXT) as phone,\n \n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n cast(State as TEXT) as state,\n \n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n cast(Status as TEXT) as status,\n \n\n\n cast(Street as TEXT) as street,\n \n\n\n cast(Title as TEXT) as title,\n \n\n\n cast(Website as TEXT) as website\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__order": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__order", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__order.sql", "original_file_path": "models/salesforce/stg_salesforce__order.sql", "unique_id": "model.salesforce_source.stg_salesforce__order", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__order"], "alias": "stg_salesforce__order", "checksum": {"name": "sha256", "checksum": "ee9f01ed785776c82f439babc5854f6bc9aa1e12387636c6fe4d85b51aafced0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an order associated with a contract or an account.", "columns": {"order_id": {"name": "order_id", "description": "order id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Required. ID of the Account associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_by_id": {"name": "activated_by_id", "description": "ID of the User who activated this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "City for the billing address for this order. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Country for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "ISO country code for the billing address for this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Postal code for the billing address for this order. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "State for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contract_id": {"name": "contract_id", "description": "ID of the contract associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "order_description": {"name": "order_description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "Order number assigned to this order (not the unique, system-generated ID assigned during creation). Maximum size is 30 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_order_id": {"name": "original_order_id", "description": "Optional. ID of the original order that a reduction order is reducing, if the reduction order is reducing a single order. Label is Original Order. Editable only if isReductionOrder is true. If the reduction order is reducing more than one order, leave blank. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Required. ID of the User or queue that owns this order. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Required. ID of the price book associated with this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Postal code of the shipping address. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Picklist of values that indicate order status. Each value is within one of two status categories defined in StatusCode. For example, the status picklist might contain Draft, Ready for Review, and Ready for Activation values with a StatusCode of Draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status_code": {"name": "status_code", "description": "The status category for the order. An order can be either Draft or Activated. Label is Status Category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_amount": {"name": "total_amount", "description": "The total amount for the order products associated with this order. This field is available in API v48.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "If you want to show more information about your order, you can add custom values to the Type picklist. By default, the Type field doesn't perform any actions or show any values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.94458, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__order\"", "raw_code": "--To disable this model, set the salesforce__order_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__order_enabled', True)) }}\n\n{% set order_column_list = get_order_columns() -%}\n{% set order_dict = column_list_to_dict(order_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','order')),\n staging_columns=order_column_list\n )\n }}\n \n from {{ source('salesforce','order') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", order_dict, alias=\"order_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"activated_by_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"activated_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_city\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_country\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_country_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_postal_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_street\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"contract_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", order_dict, alias=\"order_description\") }},\n {{ salesforce_source.coalesce_rename(\"end_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"opportunity_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"order_number\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"original_order_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"pricebook_2_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_city\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_postal_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_street\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"status\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"total_amount\", order_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"type\", order_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__order_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "order"], ["salesforce", "order"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_order_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.order"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__order.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__order_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activated_by_id\n \n as \n \n activated_by_id\n \n, \n \n \n activated_date\n \n as \n \n activated_date\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_country_code\n \n as \n \n billing_country_code\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n contract_id\n \n as \n \n contract_id\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n original_order_id\n \n as \n \n original_order_id\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n pricebook_2_id\n \n as \n \n pricebook_2_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n total_amount\n \n as \n \n total_amount\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n ActivatedById\n \n , \n cast(null as timestamp) as \n \n ActivatedDate\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingCountryCode\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as TEXT) as \n \n ContractId\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n OrderNumber\n \n , \n cast(null as TEXT) as \n \n OriginalOrderId\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n Pricebook2Id\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n , \n cast(null as float) as \n \n TotalAmount\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_order_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as order_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n coalesce(cast(ActivatedById as TEXT),\n cast(activated_by_id as TEXT))\n as activated_by_id,\n \n\n\n coalesce(cast(ActivatedDate as timestamp),\n cast(activated_date as timestamp))\n as activated_date,\n \n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n coalesce(cast(BillingCountryCode as TEXT),\n cast(billing_country_code as TEXT))\n as billing_country_code,\n \n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n coalesce(cast(ContractId as TEXT),\n cast(contract_id as TEXT))\n as contract_id,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as order_description,\n \n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n coalesce(cast(OrderNumber as TEXT),\n cast(order_number as TEXT))\n as order_number,\n \n\n\n coalesce(cast(OriginalOrderId as TEXT),\n cast(original_order_id as TEXT))\n as original_order_id,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n coalesce(cast(Pricebook2Id as TEXT),\n cast(pricebook_2_id as TEXT))\n as pricebook_2_id,\n \n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n cast(Status as TEXT) as status,\n \n\n\n coalesce(cast(TotalAmount as numeric(28,6)),\n cast(total_amount as numeric(28,6)))\n as total_amount,\n \n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__event": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__event", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__event.sql", "original_file_path": "models/salesforce/stg_salesforce__event.sql", "unique_id": "model.salesforce_source.stg_salesforce__event", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__event"], "alias": "stg_salesforce__event", "checksum": {"name": "sha256", "checksum": "4090ea3da4f9d2f147a91f5ad3ee6ca97d212dba350b887a3e770dc295817fe5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an event in the calendar. In the user interface, event and task records are collectively referred to as activities.", "columns": {"event_id": {"name": "event_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId.\nAccount Opportunity Contract Custom object that is a child of Account If the value of the WhatId field is any other object, and the value of the WhoId field is a contact object, then Salesforce uses that contact\u2019s AccountId. (If your org uses Shared Activities, Salesforce uses the AccountId of the primary contact.)\nOtherwise, Salesforce sets the value of the AccountId field to null.\nFor information on IDs, see ID Field Type.\nThis is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to true. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don\u2019t attempt to alter the timestamp to account for time zone differences. Label is Due Date Only. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to true.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date_time": {"name": "activity_date_time", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to false. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate. Label is Due Date Time. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to false.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "event_description": {"name": "event_description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Read-only. Available in versions 46.0 and later. This field supplies the date value that appears in the EndDateTime field. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date_time": {"name": "end_date_time", "description": "Available in versions 13.0 and later. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "event_subtype": {"name": "event_subtype", "description": "Provides standard subtypes to facilitate creating and searching for events. This field isn\u2019t updateable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_child": {"name": "is_child", "description": "Indicates whether the event is a child of another event (true) or not (false). For a child event, you can update IsReminderSet and ReminderDateTime only. You can query and delete a child event. If the objects related to the child event are different from those objects related to the parent event (this difference is possible if you use API version 25.0 or earlier) and one of the objects related to the child event is deleted, the objects related to the parent event are updated to ensure data integrity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_group_event": {"name": "is_group_event", "description": "Indicates whether the event is a group event\u2014that is, whether it has invitees (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence": {"name": "is_recurrence", "description": "Indicates whether a Salesforce Classic event is scheduled to repeat itself (true) or only occurs one time (false). This field is read-only when updating records, but not when creating them. If this field value is true, then RecurrenceEndDateOnly, RecurrenceStartDateTime, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. Label is Create recurring series of events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Contains the ID of the user or public calendar who owns the event. Label is Assigned to ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date_time": {"name": "start_date_time", "description": "Indicates the start date and time of the event. Available in versions 13.0 and later.\nIf this field has a value, then ActivityDate and ActivityDateTime must either be null or match the value of this field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available if your organization has enabled Shared Activities. Represents the count of related EventRelations pertaining to the WhatId. The count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Represents the count of related EventRelations pertaining to the WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.937153, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\"", "raw_code": "--To disable this model, set the salesforce__event_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__event_enabled', True)) }}\n\n{% set event_column_list = get_event_columns() -%}\n{% set event_dict = column_list_to_dict(event_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','event')),\n staging_columns=event_column_list\n )\n }}\n\n from {{ source('salesforce','event') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", event_dict, alias=\"event_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"activity_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"activity_date_time\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", event_dict, alias=\"event_description\") }},\n {{ salesforce_source.coalesce_rename(\"end_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"end_date_time\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"event_subtype\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"group_event_type\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_archived\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_child\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_group_event\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_recurrence\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"location\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"start_date_time\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"subject\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_count\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_count\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_id\", event_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__event_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "event"], ["salesforce", "event"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_event_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.event"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__event.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__event_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n activity_date_time\n \n as \n \n activity_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n end_date_time\n \n as \n \n end_date_time\n \n, \n \n \n event_subtype\n \n as \n \n event_subtype\n \n, \n \n \n group_event_type\n \n as \n \n group_event_type\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_child\n \n as \n \n is_child\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_group_event\n \n as \n \n is_group_event\n \n, \n \n \n is_recurrence\n \n as \n \n is_recurrence\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n location\n \n as \n \n location\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n start_date_time\n \n as \n \n start_date_time\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as timestamp) as \n \n ActivityDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as timestamp) as \n \n EndDateTime\n \n , \n cast(null as TEXT) as \n \n EventSubtype\n \n , \n cast(null as TEXT) as \n \n GroupEventType\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsChild\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsGroupEvent\n \n , \n cast(null as boolean) as \n \n IsRecurrence\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as timestamp) as \n \n StartDateTime\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_event_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as event_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n coalesce(cast(ActivityDateTime as timestamp),\n cast(activity_date_time as timestamp))\n as activity_date_time,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as event_description,\n \n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n coalesce(cast(EndDateTime as timestamp),\n cast(end_date_time as timestamp))\n as end_date_time,\n \n\n\n coalesce(cast(EventSubtype as TEXT),\n cast(event_subtype as TEXT))\n as event_subtype,\n \n\n\n coalesce(cast(GroupEventType as TEXT),\n cast(group_event_type as TEXT))\n as group_event_type,\n \n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n coalesce(cast(IsChild as boolean),\n cast(is_child as boolean))\n as is_child,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsGroupEvent as boolean),\n cast(is_group_event as boolean))\n as is_group_event,\n \n\n\n coalesce(cast(IsRecurrence as boolean),\n cast(is_recurrence as boolean))\n as is_recurrence,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n cast(Location as TEXT) as location,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n coalesce(cast(StartDateTime as timestamp),\n cast(start_date_time as timestamp))\n as start_date_time,\n \n\n\n cast(Subject as TEXT) as subject,\n \n\n\n cast(Type as TEXT) as type,\n \n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__product_2": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__product_2", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__product_2.sql", "original_file_path": "models/salesforce/stg_salesforce__product_2.sql", "unique_id": "model.salesforce_source.stg_salesforce__product_2", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__product_2"], "alias": "stg_salesforce__product_2", "checksum": {"name": "sha256", "checksum": "68f349725a82724226dd7e9bf1df25db2d507777024610ac74f41b1fb66205c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a product that your company sells.", "columns": {"product_2_id": {"name": "product_2_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_description": {"name": "product_2_description", "description": "A text description of this record. Label is Product Description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_url": {"name": "display_url", "description": "URL leading to a specific version of a record in the linked external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_id": {"name": "external_id", "description": "The unique identifier of a record in the linked external data source. For example, ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "family": {"name": "family", "description": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether this record is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_name": {"name": "product_2_name", "description": "Required. Default name of this record. Label is Product Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_quantity_installments": {"name": "number_of_quantity_installments", "description": "If the product has a quantity schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_revenue_installments": {"name": "number_of_revenue_installments", "description": "If the product has a revenue schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "Default product code for this record. Your org defines the product code naming pattern.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_installment_period": {"name": "quantity_installment_period", "description": "If the product has a quantity schedule, the amount of time covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_schedule_type": {"name": "quantity_schedule_type", "description": "The type of the quantity schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit_of_measure": {"name": "quantity_unit_of_measure", "description": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_installment_period": {"name": "revenue_installment_period", "description": "If the product has a revenue schedule, the time period covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_schedule_type": {"name": "revenue_schedule_type", "description": "The type of the revenue schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stock_keeping_unit": {"name": "stock_keeping_unit", "description": "The SKU for the product. Use in tandem with or instead of the ProductCode field. For example, you can track the manufacturer\u2019s identifying code in the Product Code field and assign the product a SKU when you resell it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.94715, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"", "raw_code": "--To disable this model, set the salesforce__product_2_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__product_2_enabled', True)) }}\n\n{% set product_2_column_list = get_product_2_columns() -%}\n{% set product_2_dict = column_list_to_dict(product_2_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','product_2')),\n staging_columns=product_2_column_list\n )\n }}\n \n from {{ source('salesforce','product_2') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", product_2_dict, alias=\"product_2_id\") }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", product_2_dict, alias=\"product_2_description\") }},\n {{ salesforce_source.coalesce_rename(\"display_url\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"external_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"family\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_active\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_archived\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", product_2_dict, alias=\"product_2_name\") }},\n {{ salesforce_source.coalesce_rename(\"number_of_quantity_installments\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"number_of_revenue_installments\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"product_code\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity_installment_period\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity_schedule_type\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity_unit_of_measure\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"revenue_installment_period\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"revenue_schedule_type\", product_2_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__product_2_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "product_2"], ["salesforce", "product_2"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_product_2_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.product_2"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__product_2.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__product_2_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n display_url\n \n as \n \n display_url\n \n, \n \n \n external_id\n \n as \n \n external_id\n \n, \n \n \n family\n \n as \n \n family\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_quantity_installments\n \n as \n \n number_of_quantity_installments\n \n, \n \n \n number_of_revenue_installments\n \n as \n \n number_of_revenue_installments\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity_installment_period\n \n as \n \n quantity_installment_period\n \n, \n \n \n quantity_schedule_type\n \n as \n \n quantity_schedule_type\n \n, \n \n \n quantity_unit_of_measure\n \n as \n \n quantity_unit_of_measure\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n revenue_installment_period\n \n as \n \n revenue_installment_period\n \n, \n \n \n revenue_schedule_type\n \n as \n \n revenue_schedule_type\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as TEXT) as \n \n DisplayUrl\n \n , \n cast(null as TEXT) as \n \n ExternalId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as integer) as \n \n NumberOfQuantityInstallments\n \n , \n cast(null as integer) as \n \n NumberOfRevenueInstallments\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as TEXT) as \n \n QuantityInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n QuantityScheduleType\n \n , \n cast(null as TEXT) as \n \n QuantityUnitOfMeasure\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n RevenueInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n RevenueScheduleType\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_product_2_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as product_2_id,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as product_2_description,\n \n\n\n coalesce(cast(DisplayUrl as TEXT),\n cast(display_url as TEXT))\n as display_url,\n \n\n\n coalesce(cast(ExternalId as TEXT),\n cast(external_id as TEXT))\n as external_id,\n \n\n\n cast(Family as TEXT) as family,\n \n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n cast(Name as TEXT) as product_2_name,\n \n\n\n coalesce(cast(NumberOfQuantityInstallments as integer),\n cast(number_of_quantity_installments as integer))\n as number_of_quantity_installments,\n \n\n\n coalesce(cast(NumberOfRevenueInstallments as integer),\n cast(number_of_revenue_installments as integer))\n as number_of_revenue_installments,\n \n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n coalesce(cast(QuantityInstallmentPeriod as TEXT),\n cast(quantity_installment_period as TEXT))\n as quantity_installment_period,\n \n\n\n coalesce(cast(QuantityScheduleType as TEXT),\n cast(quantity_schedule_type as TEXT))\n as quantity_schedule_type,\n \n\n\n coalesce(cast(QuantityUnitOfMeasure as TEXT),\n cast(quantity_unit_of_measure as TEXT))\n as quantity_unit_of_measure,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n coalesce(cast(RevenueInstallmentPeriod as TEXT),\n cast(revenue_installment_period as TEXT))\n as revenue_installment_period,\n \n\n\n coalesce(cast(RevenueScheduleType as TEXT),\n cast(revenue_schedule_type as TEXT))\n as revenue_schedule_type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__opportunity_line_item": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__opportunity_line_item", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__opportunity_line_item.sql", "original_file_path": "models/salesforce/stg_salesforce__opportunity_line_item.sql", "unique_id": "model.salesforce_source.stg_salesforce__opportunity_line_item", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__opportunity_line_item"], "alias": "stg_salesforce__opportunity_line_item", "checksum": {"name": "sha256", "checksum": "b40c0c11b6cbb4683706b9e9bfe23f7bb59a7607089f855239877172ab7fbd0b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an opportunity line item, which is a member of the list of Product2 products associated with an Opportunity.", "columns": {"opportunity_line_item_id": {"name": "opportunity_line_item_id", "description": "Line Item ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discount": {"name": "discount", "description": "Discount for the product as a percentage. When updating these records: If you specify Discount without specifying TotalPrice, the TotalPrice is adjusted to accommodate the new Discount value, and the UnitPrice is held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system knows which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_quantity_schedule": {"name": "has_quantity_schedule", "description": "Read-only. Indicates whether a quantity schedule has been created for this object (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_revenue_schedule": {"name": "has_revenue_schedule", "description": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_schedule": {"name": "has_schedule", "description": "If either HasQuantitySchedule or HasRevenueSchedule is true, this field is also true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "list_price": {"name": "list_price", "description": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_name": {"name": "opportunity_line_item_name", "description": "The opportunity line item name (known as \u201cOpportunity Product\u201d in the user interface). This read-only field is available in API version 30.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_entry_id": {"name": "pricebook_entry_id", "description": "Required. ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_id": {"name": "product_2_id", "description": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later. Use the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule. When updating these records: If you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_date": {"name": "service_date", "description": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored. Product Date\u2014ServiceDate is used if not null. Schedule Date\u2014ServiceDate is used if not null and there are no revenue schedules present for this line item, that is, there are no OpportunityLineItemSchedule records with a field Type value of Revenue that are children of this record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sort_order": {"name": "sort_order", "description": "Number indicating the sort order selected by the user. Client applications can use this to match the sort order in Salesforce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem. If you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unit_price": {"name": "unit_price", "description": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price. This field or TotalPrice is required. You can\u2019t specify both.\nIf you specify Discount and Quantity, this field or TotalPrice is required.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.942142, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"", "raw_code": "--To disable this model, set the salesforce__opportunity_line_item_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__opportunity_line_item_enabled', True)) }}\n\n{% set opportunity_line_item_column_list = get_opportunity_line_item_columns() -%}\n{% set opportunity_line_item_dict = column_list_to_dict(opportunity_line_item_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','opportunity_line_item')),\n staging_columns=opportunity_line_item_column_list\n )\n }}\n \n from {{ source('salesforce','opportunity_line_item') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", opportunity_line_item_dict, alias=\"opportunity_line_item_id\") }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", opportunity_line_item_dict, alias=\"opportunity_line_item_description\") }},\n {{ salesforce_source.coalesce_rename(\"discount\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_quantity_schedule\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_revenue_schedule\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_schedule\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"list_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"name\", opportunity_line_item_dict, alias=\"opportunity_line_item_name\") }},\n {{ salesforce_source.coalesce_rename(\"opportunity_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"pricebook_entry_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"product_2_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"product_code\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"service_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"sort_order\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"total_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"unit_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__opportunity_line_item_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "opportunity_line_item"], ["salesforce", "opportunity_line_item"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_opportunity_line_item_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__opportunity_line_item.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__opportunity_line_item_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n discount\n \n as \n \n discount\n \n, \n \n \n has_quantity_schedule\n \n as \n \n has_quantity_schedule\n \n, \n \n \n has_revenue_schedule\n \n as \n \n has_revenue_schedule\n \n, \n \n \n has_schedule\n \n as \n \n has_schedule\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n list_price\n \n as \n \n list_price\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n pricebook_entry_id\n \n as \n \n pricebook_entry_id\n \n, \n \n \n product_2_id\n \n as \n \n product_2_id\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n service_date\n \n as \n \n service_date\n \n, \n \n \n sort_order\n \n as \n \n sort_order\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n unit_price\n \n as \n \n unit_price\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n HasQuantitySchedule\n \n , \n cast(null as boolean) as \n \n HasRevenueSchedule\n \n , \n cast(null as boolean) as \n \n HasSchedule\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as float) as \n \n ListPrice\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n PricebookEntryId\n \n , \n cast(null as TEXT) as \n \n Product2Id\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as timestamp) as \n \n ServiceDate\n \n , \n cast(null as integer) as \n \n SortOrder\n \n , \n cast(null as float) as \n \n TotalPrice\n \n , \n cast(null as float) as \n \n UnitPrice\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_line_item_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as opportunity_line_item_id,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as opportunity_line_item_description,\n \n\n\n cast(Discount as float) as discount,\n \n\n\n coalesce(cast(HasQuantitySchedule as boolean),\n cast(has_quantity_schedule as boolean))\n as has_quantity_schedule,\n \n\n\n coalesce(cast(HasRevenueSchedule as boolean),\n cast(has_revenue_schedule as boolean))\n as has_revenue_schedule,\n \n\n\n coalesce(cast(HasSchedule as boolean),\n cast(has_schedule as boolean))\n as has_schedule,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(ListPrice as numeric(28,6)),\n cast(list_price as numeric(28,6)))\n as list_price,\n \n\n\n cast(Name as TEXT) as opportunity_line_item_name,\n \n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n coalesce(cast(PricebookEntryId as TEXT),\n cast(pricebook_entry_id as TEXT))\n as pricebook_entry_id,\n \n\n\n coalesce(cast(Product2Id as TEXT),\n cast(product_2_id as TEXT))\n as product_2_id,\n \n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n cast(Quantity as float) as quantity,\n \n\n\n coalesce(cast(ServiceDate as timestamp),\n cast(service_date as timestamp))\n as service_date,\n \n\n\n coalesce(cast(SortOrder as integer),\n cast(sort_order as integer))\n as sort_order,\n \n\n\n coalesce(cast(TotalPrice as numeric(28,6)),\n cast(total_price as numeric(28,6)))\n as total_price,\n \n\n\n coalesce(cast(UnitPrice as numeric(28,6)),\n cast(unit_price as numeric(28,6)))\n as unit_price\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__user": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__user", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__user.sql", "original_file_path": "models/salesforce/stg_salesforce__user.sql", "unique_id": "model.salesforce_source.stg_salesforce__user", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__user"], "alias": "stg_salesforce__user", "checksum": {"name": "sha256", "checksum": "d5b32139fbe202d94bf64b4720ed0cc1247d916dc76e4121043a950ed5c0c005"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a user in your organization.", "columns": {"user_id": {"name": "user_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the Account associated with a Customer Portal user. This field is null for Salesforce users.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "badge_text": {"name": "badge_text", "description": "The community role, displayed on the user profile page just below the user name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_center_id": {"name": "call_center_id", "description": "If Salesforce CRM Call Center is enabled, represents the call center to which this user is assigned.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "community_nickname": {"name": "community_nickname", "description": "Name used to identify this user in the Community application, which includes the ideas and answers features.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_id": {"name": "contact_id", "description": "ID of the Contact associated with this account. The contact must have a value in the AccountId field or an error occurs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "default_group_notification_frequency": {"name": "default_group_notification_frequency", "description": "The default frequency for sending the user's Chatter group email notifications when the user joins groups.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "delegated_approver_id": {"name": "delegated_approver_id", "description": "Id of the user who is a delegated approver for this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "digest_frequency": {"name": "digest_frequency", "description": "The frequency at which the system sends the user\u2019s Chatter personal email digest.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_encoding_key": {"name": "email_encoding_key", "description": "Required. The email encoding for the user, such as ISO-8859-1 or UTF-8.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_preferences_auto_bcc": {"name": "email_preferences_auto_bcc", "description": "Determines whether the user receives copies of sent emails. This option applies only if compliance BCC emails are not enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "federation_identifier": {"name": "federation_identifier", "description": "Indicates the value that must be listed in the Subject element of a Security Assertion Markup Language (SAML) IDP certificate to authenticate the user for a client application using single sign-on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_enabled": {"name": "forecast_enabled", "description": "Indicates whether the user is enabled as a forecast manager (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "The level of accuracy of a location\u2019s geographical coordinates compared with its physical address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this user. This field is available if Data Protection and Privacy is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether the user has access to log in (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_profile_photo_active": {"name": "is_profile_photo_active", "description": "Indicates whether a user has a profile photo (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language_locale_key": {"name": "language_locale_key", "description": "Required. The user\u2019s language, such as \u201cFrench\u201d or \u201cChinese (Traditional).\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_login_date": {"name": "last_login_date", "description": "The date and time when the user last successfully logged in. This value is updated if 60 seconds have elapsed since the user\u2019s last login.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "locale_sid_key": {"name": "locale_sid_key", "description": "Required. This field is a restricted picklist field. The value of the field affects formatting and parsing of values, especially numeric values, in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medium_banner_photo_url": {"name": "medium_banner_photo_url", "description": "The URL for the medium-sized user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_name": {"name": "user_name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "offline_trial_expiration_date": {"name": "offline_trial_expiration_date", "description": "The date and time when the user\u2019s Connect Offline trial expires.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_id": {"name": "profile_id", "description": "Required. ID of the user\u2019s Profile. Use this value to cache metadata based on profile. In earlier releases, this was RoleId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_admin_info_emails": {"name": "receives_admin_info_emails", "description": "Indicates whether the user receives email for administrators from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_info_emails": {"name": "receives_info_emails", "description": "Indicates whether the user receives informational email from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_email": {"name": "sender_email", "description": "The email address used as the From address when the user sends emails. This address is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_name": {"name": "sender_name", "description": "The name used as the email sender when the user sends emails. This name is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_banner_photo_url": {"name": "small_banner_photo_url", "description": "The URL for the small user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_photo_url": {"name": "small_photo_url", "description": "The URL for a thumbnail of the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "time_zone_sid_key": {"name": "time_zone_sid_key", "description": "Required. This field is a restricted picklist field. A User time zone affects the offset used when displaying or entering times in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "username": {"name": "username", "description": "Contains the name that a user enters to log in. The value for this field must be in the form of an email address, using all lowercase characters. It must also be unique across all organizations.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table"}, "created_at": 1720572444.929953, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"", "raw_code": "{% set user_column_list = get_user_columns() -%}\n{% set user_dict = column_list_to_dict(user_column_list) -%}\n\nwith fields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','user')),\n staging_columns=user_column_list\n )\n }}\n\n from {{ source('salesforce','user') }}\n), \n\nfinal as (\n \n select \n _fivetran_deleted,\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"account_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"alias\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"city\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"company_name\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"contact_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"country\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"country_code\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"department\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"email\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"first_name\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"id\", user_dict, alias=\"user_id\" ) }},\n {{ salesforce_source.coalesce_rename(\"individual_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"is_active\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_login_date\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_name\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"manager_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"name\", user_dict, alias=\"user_name\" ) }},\n {{ salesforce_source.coalesce_rename(\"postal_code\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"profile_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"state\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"state_code\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"street\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"title\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"user_role_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"user_type\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"username\", user_dict ) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__user_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect * \nfrom final", "language": "sql", "refs": [], "sources": [["salesforce", "user"], ["salesforce", "user"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_user_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.user"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__user.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n alias\n \n as \n \n alias\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company_name\n \n as \n \n company_name\n \n, \n \n \n contact_id\n \n as \n \n contact_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n last_login_date\n \n as \n \n last_login_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n manager_id\n \n as \n \n manager_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n profile_id\n \n as \n \n profile_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n user_role_id\n \n as \n \n user_role_id\n \n, \n \n \n user_type\n \n as \n \n user_type\n \n, \n \n \n username\n \n as \n \n username\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CompanyName\n \n , \n cast(null as TEXT) as \n \n ContactId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as timestamp) as \n \n LastLoginDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n ManagerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n ProfileId\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n , \n cast(null as TEXT) as \n \n UserRoleId\n \n , \n cast(null as TEXT) as \n \n UserType\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_data\"\n), \n\nfinal as (\n \n select \n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n cast(Alias as TEXT) as alias,\n \n\n\n cast(City as TEXT) as city,\n \n\n\n coalesce(cast(CompanyName as TEXT),\n cast(company_name as TEXT))\n as company_name,\n \n\n\n coalesce(cast(ContactId as TEXT),\n cast(contact_id as TEXT))\n as contact_id,\n \n\n\n cast(Country as TEXT) as country,\n \n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n cast(Department as TEXT) as department,\n \n\n\n cast(Email as TEXT) as email,\n \n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n cast(Id as TEXT) as user_id,\n \n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n coalesce(cast(LastLoginDate as timestamp),\n cast(last_login_date as timestamp))\n as last_login_date,\n \n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(ManagerId as TEXT),\n cast(manager_id as TEXT))\n as manager_id,\n \n\n\n cast(Name as TEXT) as user_name,\n \n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n coalesce(cast(ProfileId as TEXT),\n cast(profile_id as TEXT))\n as profile_id,\n \n\n\n cast(State as TEXT) as state,\n \n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n cast(Street as TEXT) as street,\n \n\n\n cast(Title as TEXT) as title,\n \n\n\n coalesce(cast(UserRoleId as TEXT),\n cast(user_role_id as TEXT))\n as user_role_id,\n \n\n\n coalesce(cast(UserType as TEXT),\n cast(user_type as TEXT))\n as user_type,\n \n\n\n cast(Username as TEXT) as username\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, 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}, "model.salesforce_source.stg_salesforce__task": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "stg_salesforce__task", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__task.sql", "original_file_path": "models/salesforce/stg_salesforce__task.sql", "unique_id": "model.salesforce_source.stg_salesforce__task", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__task"], "alias": "stg_salesforce__task", "checksum": {"name": "sha256", "checksum": "2a4ca02e3d0a49f3789844be9bb180ee2876fd844ee887102b4df684acd9b63c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a business activity such as making a phone call or other to-do items. In the user interface, Task and Event records are collectively referred to as activities.", "columns": {"task_id": {"name": "task_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related Account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId. Account Opportunity Contract Custom object that is a child of Account If the value of the WhatIdfield is any other object, and the value of the WhoId field is a Contact object, then Salesforce uses that contact\u2019s AccountId. (If your organization uses Shared Activities, then Salesforce uses the AccountId of the primary contact.) Otherwise, Salesforce sets the value of the AccountId field to null. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Represents the due date of the task. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. Label is Due Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_disposition": {"name": "call_disposition", "description": "Represents the result of a given call, for example, \u201cwe'll call back,\u201d or \u201ccall unsuccessful.\u201d Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_duration_in_seconds": {"name": "call_duration_in_seconds", "description": "Duration of the call in seconds. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_object": {"name": "call_object", "description": "Name of a call center. Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "completed_date_time": {"name": "completed_date_time", "description": "The date and time the task was saved with a Closed status. For insert, if the task is saved with a Closed status the field is set. If the task is saved with an Open status the field is set to NULL. For update, if the task is saved with a new Closed status, the field is reset. If the task is saved with a new non-closed status, the field is reset to NULL. If the task is saved with the same closed status (that is, unchanged) there is no change to the field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "task_description": {"name": "task_description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Indicates whether the task has been completed (true) or not (false). Is only set indirectly via the Status picklist. Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_high_priority": {"name": "is_high_priority", "description": "Indicates a high-priority task. This field is derived from the Priority field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User or Group who owns the record. Label is Assigned To ID. This field accepts Groups of type Queue only. In the user interface, Group IDs correspond with the queue\u2019s list view names. To create or update tasks assigned to Group, use v48.0 or later. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "priority": {"name": "priority", "description": "Required. Indicates the importance or urgency of a task, such as high or low.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Required. The status of the task, such as In Progress or Completed. Each predefined Status field implies a value for the IsClosed flag. To obtain picklist values, query the TaskStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the task, such as \u201cCall\u201d or \u201cSend Quote.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "task_subtype": {"name": "task_subtype", "description": "Provides standard subtypes to facilitate creating and searching for specific task subtypes.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhatId. Count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID. If Shared Activities is enabled, the value of this field is the ID of the related lead or primary contact. If you add, update, or remove the WhoId field, you might encounter problems with triggers, workflows, and data validation rules that are associated with the record. The label is Name ID. Beginning in API version 37.0, if the contact or lead ID in the WhoId field is not in the TaskWhoIds list, no error occurs and the ID is added to the TaskWhoIds as the primary WhoId. If WhoId is set to null, an arbitrary ID from the existing TaskWhoIds list is promoted to the primary position.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1720572444.949486, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"", "raw_code": "--To disable this model, set the salesforce__task_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__task_enabled', True)) }}\n\n{% set task_column_list = get_task_columns() -%}\n{% set task_dict = column_list_to_dict(task_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','task')),\n staging_columns=task_column_list\n )\n }}\n \n from {{ source('salesforce','task') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", task_dict, alias=\"task_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"activity_date\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_disposition\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_duration_in_seconds\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_object\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_type\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"completed_date_time\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", task_dict, alias=\"task_description\") }},\n {{ salesforce_source.coalesce_rename(\"is_archived\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_closed\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_high_priority\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"priority\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"status\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"subject\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"task_subtype\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_count\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_count\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_id\", task_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__task_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "task"], ["salesforce", "task"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_task_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.task"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__task.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__task_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n call_disposition\n \n as \n \n call_disposition\n \n, \n \n \n call_duration_in_seconds\n \n as \n \n call_duration_in_seconds\n \n, \n \n \n call_object\n \n as \n \n call_object\n \n, \n \n \n call_type\n \n as \n \n call_type\n \n, \n \n \n completed_date_time\n \n as \n \n completed_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_high_priority\n \n as \n \n is_high_priority\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n priority\n \n as \n \n priority\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n task_subtype\n \n as \n \n task_subtype\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as TEXT) as \n \n CallDisposition\n \n , \n cast(null as integer) as \n \n CallDurationInSeconds\n \n , \n cast(null as TEXT) as \n \n CallObject\n \n , \n cast(null as TEXT) as \n \n CallType\n \n , \n cast(null as timestamp) as \n \n CompletedDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsHighPriority\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n TaskSubtype\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_task_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as task_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n coalesce(cast(CallDisposition as TEXT),\n cast(call_disposition as TEXT))\n as call_disposition,\n \n\n\n coalesce(cast(CallDurationInSeconds as integer),\n cast(call_duration_in_seconds as integer))\n as call_duration_in_seconds,\n \n\n\n coalesce(cast(CallObject as TEXT),\n cast(call_object as TEXT))\n as call_object,\n \n\n\n coalesce(cast(CallType as TEXT),\n cast(call_type as TEXT))\n as call_type,\n \n\n\n coalesce(cast(CompletedDateTime as timestamp),\n cast(completed_date_time as timestamp))\n as completed_date_time,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as task_description,\n \n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsHighPriority as boolean),\n cast(is_high_priority as boolean))\n as is_high_priority,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Priority as TEXT) as priority,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n cast(Status as TEXT) as status,\n \n\n\n cast(Subject as TEXT) as subject,\n \n\n\n coalesce(cast(TaskSubtype as TEXT),\n cast(task_subtype as TEXT))\n as task_subtype,\n \n\n\n cast(Type as TEXT) as type,\n \n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__account_daily_history_account_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__account_daily_history_account_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__account_daily_history_account_day_id"], "alias": "unique_salesforce__account_daily_history_account_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.7615428, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__account_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__account_daily_history_account_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is not null\ngroup by account_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_day_id", "file_key_name": "models.salesforce__account_daily_history", "attached_node": "model.salesforce.salesforce__account_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_day_id", "model": "{{ get_where_subquery(ref('salesforce__account_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__account_daily_history_account_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__account_daily_history_account_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__account_daily_history_account_day_id"], "alias": "not_null_salesforce__account_daily_history_account_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.762877, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__account_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__account_daily_history_account_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_day_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_day_id", "file_key_name": "models.salesforce__account_daily_history", "attached_node": "model.salesforce.salesforce__account_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_day_id", "model": "{{ get_where_subquery(ref('salesforce__account_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__contact_daily_history_contact_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__contact_daily_history_contact_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__contact_daily_history_contact_day_id"], "alias": "unique_salesforce__contact_daily_history_contact_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.763903, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__contact_daily_history_contact_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is not null\ngroup by contact_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_day_id", "file_key_name": "models.salesforce__contact_daily_history", "attached_node": "model.salesforce.salesforce__contact_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_day_id", "model": "{{ get_where_subquery(ref('salesforce__contact_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__contact_daily_history_contact_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__contact_daily_history_contact_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__contact_daily_history_contact_day_id"], "alias": "not_null_salesforce__contact_daily_history_contact_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.764884, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__contact_daily_history_contact_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_day_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_day_id", "file_key_name": "models.salesforce__contact_daily_history", "attached_node": "model.salesforce.salesforce__contact_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "contact_day_id", "model": "{{ get_where_subquery(ref('salesforce__contact_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__opportunity_daily_history_opportunity_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__opportunity_daily_history_opportunity_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__opportunity_daily_history_opportunity_day_id"], "alias": "unique_salesforce__opportunity_daily_history_opportunity_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.765868, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__opportunity_daily_history_opportunity_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is not null\ngroup by opportunity_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_day_id", "file_key_name": "models.salesforce__opportunity_daily_history", "attached_node": "model.salesforce.salesforce__opportunity_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_day_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__opportunity_daily_history_opportunity_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__opportunity_daily_history_opportunity_day_id"], "alias": "not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f"}, "created_at": 1720572444.766904, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f\") }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_day_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_day_id", "file_key_name": "models.salesforce__opportunity_daily_history", "attached_node": "model.salesforce.salesforce__opportunity_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_day_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__manager_performance_manager_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__manager_performance_manager_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650", "fqn": ["salesforce", "salesforce", "unique_salesforce__manager_performance_manager_id"], "alias": "unique_salesforce__manager_performance_manager_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.794341, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__manager_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__manager_performance_manager_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n manager_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is not null\ngroup by manager_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "manager_id", "file_key_name": "models.salesforce__manager_performance", "attached_node": "model.salesforce.salesforce__manager_performance", "test_metadata": {"name": "unique", "kwargs": {"column_name": "manager_id", "model": "{{ get_where_subquery(ref('salesforce__manager_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__manager_performance_manager_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__manager_performance_manager_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "fqn": ["salesforce", "salesforce", "not_null_salesforce__manager_performance_manager_id"], "alias": "not_null_salesforce__manager_performance_manager_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.795361, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__manager_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__manager_performance_manager_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect manager_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "manager_id", "file_key_name": "models.salesforce__manager_performance", "attached_node": "model.salesforce.salesforce__manager_performance", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "manager_id", "model": "{{ get_where_subquery(ref('salesforce__manager_performance')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__owner_performance_owner_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__owner_performance_owner_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7", "fqn": ["salesforce", "salesforce", "unique_salesforce__owner_performance_owner_id"], "alias": "unique_salesforce__owner_performance_owner_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.796345, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__owner_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__owner_performance_owner_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n owner_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is not null\ngroup by owner_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "owner_id", "file_key_name": "models.salesforce__owner_performance", "attached_node": "model.salesforce.salesforce__owner_performance", "test_metadata": {"name": "unique", "kwargs": {"column_name": "owner_id", "model": "{{ get_where_subquery(ref('salesforce__owner_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__owner_performance_owner_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__owner_performance_owner_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7", "fqn": ["salesforce", "salesforce", "not_null_salesforce__owner_performance_owner_id"], "alias": "not_null_salesforce__owner_performance_owner_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.797363, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__owner_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__owner_performance_owner_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect owner_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "owner_id", "file_key_name": "models.salesforce__owner_performance", "attached_node": "model.salesforce.salesforce__owner_performance", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "owner_id", "model": "{{ get_where_subquery(ref('salesforce__owner_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__opportunity_enhanced_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__opportunity_enhanced_opportunity_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc", "fqn": ["salesforce", "salesforce", "not_null_salesforce__opportunity_enhanced_opportunity_id"], "alias": "not_null_salesforce__opportunity_enhanced_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.7983391, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__opportunity_enhanced_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.salesforce__opportunity_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_enhanced", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_enhanced')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__opportunity_enhanced_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__opportunity_enhanced_opportunity_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788", "fqn": ["salesforce", "salesforce", "unique_salesforce__opportunity_enhanced_opportunity_id"], "alias": "unique_salesforce__opportunity_enhanced_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.799309, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__opportunity_enhanced_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.salesforce__opportunity_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_enhanced", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_enhanced')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__contact_enhanced_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__contact_enhanced_contact_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e", "fqn": ["salesforce", "salesforce", "unique_salesforce__contact_enhanced_contact_id"], "alias": "unique_salesforce__contact_enhanced_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.8002748, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__contact_enhanced_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.salesforce__contact_enhanced", "attached_node": "model.salesforce.salesforce__contact_enhanced", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('salesforce__contact_enhanced')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__contact_enhanced_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__contact_enhanced_contact_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "fqn": ["salesforce", "salesforce", "not_null_salesforce__contact_enhanced_contact_id"], "alias": "not_null_salesforce__contact_enhanced_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.801227, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__contact_enhanced_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.salesforce__contact_enhanced", "attached_node": "model.salesforce.salesforce__contact_enhanced", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('salesforce__contact_enhanced')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__daily_activity_date_day", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__daily_activity_date_day.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04", "fqn": ["salesforce", "salesforce", "unique_salesforce__daily_activity_date_day"], "alias": "unique_salesforce__daily_activity_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.802371, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__daily_activity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__daily_activity_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.salesforce__daily_activity", "attached_node": "model.salesforce.salesforce__daily_activity", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('salesforce__daily_activity')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__daily_activity_date_day", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__daily_activity_date_day.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "fqn": ["salesforce", "salesforce", "not_null_salesforce__daily_activity_date_day"], "alias": "not_null_salesforce__daily_activity_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.8033438, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__daily_activity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__daily_activity_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.salesforce__daily_activity", "attached_node": "model.salesforce.salesforce__daily_activity", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('salesforce__daily_activity')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32", "fqn": ["salesforce", "salesforce", "unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id"], "alias": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9"}, "created_at": 1720572444.804311, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9\") }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_line_item_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.salesforce__opportunity_line_item_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_line_item_enhanced", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_line_item_enhanced')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa", "fqn": ["salesforce", "salesforce", "not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id"], "alias": "not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12"}, "created_at": 1720572444.8052878, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12\") }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_line_item_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.salesforce__opportunity_line_item_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_line_item_enhanced", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_line_item_enhanced')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "fqn": ["salesforce_source", "salesforce_history", "not_null_stg_salesforce__account_history_history_unique_key"], "alias": "not_null_stg_salesforce__account_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.846974, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/not_null_stg_salesforce__account_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\nwhere history_unique_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__account_history", "attached_node": "model.salesforce_source.stg_salesforce__account_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__account_history')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f", "fqn": ["salesforce_source", "salesforce_history", "unique_stg_salesforce__account_history_history_unique_key"], "alias": "unique_stg_salesforce__account_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.848028, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/unique_stg_salesforce__account_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__account_history", "attached_node": "model.salesforce_source.stg_salesforce__account_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__account_history')) }}"}, "namespace": null}}, "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end", "resource_type": "test", "package_name": "salesforce_source", "path": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6", "fqn": ["salesforce_source", "salesforce_history", "dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end"], "alias": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b"}, "created_at": 1720572444.8490171, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b.sql", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n account_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\n group by account_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_salesforce__account_history", "attached_node": "model.salesforce_source.stg_salesforce__account_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["account_id", "_fivetran_start", "_fivetran_end"], "model": "{{ get_where_subquery(ref('stg_salesforce__account_history')) }}"}, "namespace": "dbt_utils"}}, "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "fqn": ["salesforce_source", "salesforce_history", "not_null_stg_salesforce__contact_history_history_unique_key"], "alias": "not_null_stg_salesforce__contact_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.8609228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/not_null_stg_salesforce__contact_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__contact_history", "attached_node": "model.salesforce_source.stg_salesforce__contact_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__contact_history')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d", "fqn": ["salesforce_source", "salesforce_history", "unique_stg_salesforce__contact_history_history_unique_key"], "alias": "unique_stg_salesforce__contact_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.862004, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/unique_stg_salesforce__contact_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__contact_history", "attached_node": "model.salesforce_source.stg_salesforce__contact_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__contact_history')) }}"}, "namespace": null}}, "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end", "resource_type": "test", "package_name": "salesforce_source", "path": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee", "fqn": ["salesforce_source", "salesforce_history", "dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end"], "alias": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2"}, "created_at": 1720572444.863014, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2.sql", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n contact_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\n group by contact_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_salesforce__contact_history", "attached_node": "model.salesforce_source.stg_salesforce__contact_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["contact_id", "_fivetran_start", "_fivetran_end"], "model": "{{ get_where_subquery(ref('stg_salesforce__contact_history')) }}"}, "namespace": "dbt_utils"}}, "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "fqn": ["salesforce_source", "salesforce_history", "not_null_stg_salesforce__opportunity_history_history_unique_key"], "alias": "not_null_stg_salesforce__opportunity_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.865417, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/not_null_stg_salesforce__opportunity_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__opportunity_history", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_history')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67", "fqn": ["salesforce_source", "salesforce_history", "unique_stg_salesforce__opportunity_history_history_unique_key"], "alias": "unique_stg_salesforce__opportunity_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.8664021, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/unique_stg_salesforce__opportunity_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__opportunity_history", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_history')) }}"}, "namespace": null}}, "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end", "resource_type": "test", "package_name": "salesforce_source", "path": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435", "fqn": ["salesforce_source", "salesforce_history", "dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end"], "alias": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9"}, "created_at": 1720572444.8673868, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9.sql", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n opportunity_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\n group by opportunity_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_salesforce__opportunity_history", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["opportunity_id", "_fivetran_start", "_fivetran_end"], "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_history')) }}"}, "namespace": "dbt_utils"}}, "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__account_account_id"], "alias": "not_null_stg_salesforce__account_account_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.950038, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__account_account_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_id", "file_key_name": "models.stg_salesforce__account", "attached_node": "model.salesforce_source.stg_salesforce__account", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_salesforce__account')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__account_account_id"], "alias": "unique_stg_salesforce__account_account_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.951133, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__account_account_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\nwhere account_id is not null\ngroup by account_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_id", "file_key_name": "models.stg_salesforce__account", "attached_node": "model.salesforce_source.stg_salesforce__account", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_salesforce__account')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__opportunity_opportunity_id"], "alias": "not_null_stg_salesforce__opportunity_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.952115, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__opportunity_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.stg_salesforce__opportunity", "attached_node": "model.salesforce_source.stg_salesforce__opportunity", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__opportunity_opportunity_id"], "alias": "unique_stg_salesforce__opportunity_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.953078, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__opportunity_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.stg_salesforce__opportunity", "attached_node": "model.salesforce_source.stg_salesforce__opportunity", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__user_user_id"], "alias": "not_null_stg_salesforce__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.954038, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__user_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "models.stg_salesforce__user", "attached_node": "model.salesforce_source.stg_salesforce__user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__user_user_id"], "alias": "unique_stg_salesforce__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.954992, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__user_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "models.stg_salesforce__user", "attached_node": "model.salesforce_source.stg_salesforce__user", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__user_role_user_role_id"], "alias": "not_null_stg_salesforce__user_role_user_role_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.956001, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__user_role_user_role_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_role_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\nwhere user_role_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_role_id", "file_key_name": "models.stg_salesforce__user_role", "attached_node": "model.salesforce_source.stg_salesforce__user_role", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_role_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user_role')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__user_role_user_role_id"], "alias": "unique_stg_salesforce__user_role_user_role_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.9569569, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__user_role_user_role_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_role_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\nwhere user_role_id is not null\ngroup by user_role_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_role_id", "file_key_name": "models.stg_salesforce__user_role", "attached_node": "model.salesforce_source.stg_salesforce__user_role", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_role_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user_role')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__contact_contact_id"], "alias": "not_null_stg_salesforce__contact_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.957916, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__contact_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"\nwhere contact_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.stg_salesforce__contact", "attached_node": "model.salesforce_source.stg_salesforce__contact", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('stg_salesforce__contact')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__contact_contact_id"], "alias": "unique_stg_salesforce__contact_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.9588768, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__contact_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.stg_salesforce__contact", "attached_node": "model.salesforce_source.stg_salesforce__contact", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('stg_salesforce__contact')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__event_event_id"], "alias": "not_null_stg_salesforce__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.959887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__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_salesforce__event", "attached_node": "model.salesforce_source.stg_salesforce__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_salesforce__event')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__event_event_id"], "alias": "unique_stg_salesforce__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.96085, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n event_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\"\nwhere event_id is not null\ngroup by event_id\nhaving count(*) > 1\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_salesforce__event", "attached_node": "model.salesforce_source.stg_salesforce__event", "test_metadata": {"name": "unique", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_salesforce__event')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__lead_lead_id"], "alias": "not_null_stg_salesforce__lead_lead_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.9618108, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__lead_lead_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lead_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\nwhere lead_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lead_id", "file_key_name": "models.stg_salesforce__lead", "attached_node": "model.salesforce_source.stg_salesforce__lead", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lead_id", "model": "{{ get_where_subquery(ref('stg_salesforce__lead')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__lead_lead_id"], "alias": "unique_stg_salesforce__lead_lead_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.962764, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__lead_lead_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n lead_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\nwhere lead_id is not null\ngroup by lead_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lead_id", "file_key_name": "models.stg_salesforce__lead", "attached_node": "model.salesforce_source.stg_salesforce__lead", "test_metadata": {"name": "unique", "kwargs": {"column_name": "lead_id", "model": "{{ get_where_subquery(ref('stg_salesforce__lead')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id"], "alias": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b"}, "created_at": 1720572444.963742, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.stg_salesforce__opportunity_line_item", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_line_item", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_line_item')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id"], "alias": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4"}, "created_at": 1720572444.964747, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.stg_salesforce__opportunity_line_item", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_line_item", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_line_item')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__order_order_id"], "alias": "not_null_stg_salesforce__order_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.965703, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__order_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__order\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_salesforce__order", "attached_node": "model.salesforce_source.stg_salesforce__order", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_salesforce__order')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__order_order_id"], "alias": "unique_stg_salesforce__order_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.9666681, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__order_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__order\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_salesforce__order", "attached_node": "model.salesforce_source.stg_salesforce__order", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_salesforce__order')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__product_2_product_2_id"], "alias": "not_null_stg_salesforce__product_2_product_2_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.9676301, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__product_2_product_2_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect product_2_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"\nwhere product_2_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "product_2_id", "file_key_name": "models.stg_salesforce__product_2", "attached_node": "model.salesforce_source.stg_salesforce__product_2", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "product_2_id", "model": "{{ get_where_subquery(ref('stg_salesforce__product_2')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__product_2_product_2_id"], "alias": "unique_stg_salesforce__product_2_product_2_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.968627, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__product_2_product_2_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n product_2_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"\nwhere product_2_id is not null\ngroup by product_2_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "product_2_id", "file_key_name": "models.stg_salesforce__product_2", "attached_node": "model.salesforce_source.stg_salesforce__product_2", "test_metadata": {"name": "unique", "kwargs": {"column_name": "product_2_id", "model": "{{ get_where_subquery(ref('stg_salesforce__product_2')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "not_null_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__task_task_id"], "alias": "not_null_stg_salesforce__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.969586, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__task_task_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_id", "file_key_name": "models.stg_salesforce__task", "attached_node": "model.salesforce_source.stg_salesforce__task", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_salesforce__task')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605": {"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "unique_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__task_task_id"], "alias": "unique_stg_salesforce__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1720572444.970546, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__task_task_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n task_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_id", "file_key_name": "models.stg_salesforce__task", "attached_node": "model.salesforce_source.stg_salesforce__task", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_salesforce__task')) }}"}, "namespace": null}}}, "sources": {"source.salesforce_source.salesforce_history.account": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "account", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce_history/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/src_salesforce_history.yml", "unique_id": "source.salesforce_source.salesforce_history.account", "fqn": ["salesforce_source", "salesforce_history", "salesforce_history", "account"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_account_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents historical records of individual accounts, which are organizations or people involved with your business (such as customers, competitors, and partners).", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_history_data\"", "created_at": 1720572444.997663}, "source.salesforce_source.salesforce_history.contact": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "contact", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce_history/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/src_salesforce_history.yml", "unique_id": "source.salesforce_source.salesforce_history.contact", "fqn": ["salesforce_source", "salesforce_history", "salesforce_history", "contact"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_contact_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents the historical record of contacts, which are people associated with an account.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_history_data\"", "created_at": 1720572444.998467}, "source.salesforce_source.salesforce_history.opportunity": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "opportunity", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce_history/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/src_salesforce_history.yml", "unique_id": "source.salesforce_source.salesforce_history.opportunity", "fqn": ["salesforce_source", "salesforce_history", "salesforce_history", "opportunity"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_opportunity_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents historical records of opportunities, which are sales or pending deals.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_history_data\"", "created_at": 1720572444.998623}, "source.salesforce_source.salesforce.account": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "account", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.account", "fqn": ["salesforce_source", "salesforce", "salesforce", "account"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_account_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "The ISO country code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode for the billing address. See Compound Field Considerations and Limitations for details on geolocation compound fields.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_latitude": {"name": "billing_latitude", "description": "Used with BillingLongitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_longitude": {"name": "billing_longitude", "description": "Used with BillingLatitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "The ISO state code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_company_id": {"name": "jigsaw_company_id", "description": "References the ID of a company in Data.com. If an account has a value in this field, it means that the account was imported from Data.com.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "The ISO country code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_latitude": {"name": "shipping_latitude", "description": "Used with ShippingLongitude to specify the precise geolocation of a shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "The ISO state code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic": {"name": "sic", "description": "Standard Industrial Classification code of the company\u2019s main business categorization, for example, 57340 for Electronics.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic_desc": {"name": "sic_desc", "description": "A brief description of an organization\u2019s line of business, based on its SIC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ticker_symbol": {"name": "ticker_symbol", "description": "The stock market symbol for this account. This field is available on business accounts, not person accounts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_data\"", "created_at": 1720572444.999035}, "source.salesforce_source.salesforce.opportunity": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "opportunity", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.opportunity", "fqn": ["salesforce_source", "salesforce", "salesforce", "opportunity"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_opportunity_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents an opportunity, which is a sale or pending deal.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_excluded_from_territory_2_filter": {"name": "is_excluded_from_territory_2_filter", "description": "Used for Filter-Based Opportunity Territory Assignment. Indicates whether the opportunity is excluded (True) or included (False) each time the APEX filter is executed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "Pricebook2Id": {"name": "Pricebook2Id", "description": "ID of a related Pricebook2 object. The Pricebook2Id field indicates which Pricebook2 applies to this opportunity. The Pricebook2Id field is defined only for those organizations that have products enabled as a feature. You can specify values for only one field (Pricebook2Id or PricebookId)\u2014not both fields. For this reason, both fields are declared nillable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Unavailable as of version 3.0. As of version 8.0, the Pricebook object is no longer available. Use the Pricebook2Id field instead, specifying the ID of the Pricebook2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "territory_2_id": {"name": "territory_2_id", "description": "The ID of the territory that is assigned to the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_data\"", "created_at": 1720572444.999177}, "source.salesforce_source.salesforce.user": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "user", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.user", "fqn": ["salesforce_source", "salesforce", "salesforce", "user"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a user in your organization.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the Account associated with a Customer Portal user. This field is null for Salesforce users.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "badge_text": {"name": "badge_text", "description": "The community role, displayed on the user profile page just below the user name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_center_id": {"name": "call_center_id", "description": "If Salesforce CRM Call Center is enabled, represents the call center to which this user is assigned.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "community_nickname": {"name": "community_nickname", "description": "Name used to identify this user in the Community application, which includes the ideas and answers features.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_id": {"name": "contact_id", "description": "ID of the Contact associated with this account. The contact must have a value in the AccountId field or an error occurs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "default_group_notification_frequency": {"name": "default_group_notification_frequency", "description": "The default frequency for sending the user's Chatter group email notifications when the user joins groups.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "delegated_approver_id": {"name": "delegated_approver_id", "description": "Id of the user who is a delegated approver for this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "digest_frequency": {"name": "digest_frequency", "description": "The frequency at which the system sends the user\u2019s Chatter personal email digest.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_encoding_key": {"name": "email_encoding_key", "description": "Required. The email encoding for the user, such as ISO-8859-1 or UTF-8.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_preferences_auto_bcc": {"name": "email_preferences_auto_bcc", "description": "Determines whether the user receives copies of sent emails. This option applies only if compliance BCC emails are not enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "federation_identifier": {"name": "federation_identifier", "description": "Indicates the value that must be listed in the Subject element of a Security Assertion Markup Language (SAML) IDP certificate to authenticate the user for a client application using single sign-on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_enabled": {"name": "forecast_enabled", "description": "Indicates whether the user is enabled as a forecast manager (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "The level of accuracy of a location\u2019s geographical coordinates compared with its physical address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this user. This field is available if Data Protection and Privacy is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether the user has access to log in (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_profile_photo_active": {"name": "is_profile_photo_active", "description": "Indicates whether a user has a profile photo (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language_locale_key": {"name": "language_locale_key", "description": "Required. The user\u2019s language, such as \u201cFrench\u201d or \u201cChinese (Traditional).\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_login_date": {"name": "last_login_date", "description": "The date and time when the user last successfully logged in. This value is updated if 60 seconds have elapsed since the user\u2019s last login.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "locale_sid_key": {"name": "locale_sid_key", "description": "Required. This field is a restricted picklist field. The value of the field affects formatting and parsing of values, especially numeric values, in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medium_banner_photo_url": {"name": "medium_banner_photo_url", "description": "The URL for the medium-sized user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "offline_trial_expiration_date": {"name": "offline_trial_expiration_date", "description": "The date and time when the user\u2019s Connect Offline trial expires.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_id": {"name": "profile_id", "description": "Required. ID of the user\u2019s Profile. Use this value to cache metadata based on profile. In earlier releases, this was RoleId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_admin_info_emails": {"name": "receives_admin_info_emails", "description": "Indicates whether the user receives email for administrators from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_info_emails": {"name": "receives_info_emails", "description": "Indicates whether the user receives informational email from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_email": {"name": "sender_email", "description": "The email address used as the From address when the user sends emails. This address is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_name": {"name": "sender_name", "description": "The name used as the email sender when the user sends emails. This name is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_banner_photo_url": {"name": "small_banner_photo_url", "description": "The URL for the small user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_photo_url": {"name": "small_photo_url", "description": "The URL for a thumbnail of the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "time_zone_sid_key": {"name": "time_zone_sid_key", "description": "Required. This field is a restricted picklist field. A User time zone affects the offset used when displaying or entering times in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "username": {"name": "username", "description": "Contains the name that a user enters to log in. The value for this field must be in the form of an email address, using all lowercase characters. It must also be unique across all organizations.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_data\"", "created_at": 1720572444.999344}, "source.salesforce_source.salesforce.user_role": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "user_role", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.user_role", "fqn": ["salesforce_source", "salesforce", "salesforce", "user_role"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_user_role_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a user role in your organization.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "case_access_for_account_owner": {"name": "case_access_for_account_owner", "description": "The case access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_access_for_account_owner": {"name": "contact_access_for_account_owner", "description": "The contact access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_user_id": {"name": "forecast_user_id", "description": "The ID of the forecast manager associated with this role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "may_forecast_manager_share": {"name": "may_forecast_manager_share", "description": "Indicates whether the forecast manager can manually share their own forecast.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Name of the role. Corresponds to Label on the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_access_for_account_owner": {"name": "opportunity_access_for_account_owner", "description": "Required. The opportunity access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_role_data\"", "created_at": 1720572444.999456}, "source.salesforce_source.salesforce.contact": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "contact", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.contact", "fqn": ["salesforce_source", "salesforce", "salesforce", "contact"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_contact_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a contact, which is a person associated with an account.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "assistant_name": {"name": "assistant_name", "description": "The assistant\u2019s name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "assistant_phone": {"name": "assistant_phone", "description": "The assistant\u2019s telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birthdate": {"name": "birthdate", "description": "The contact\u2019s birthdate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "do_not_call": {"name": "do_not_call", "description": "Indicates that the contact does not want to receive calls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_date": {"name": "email_bounced_date", "description": "If bounce management is activated and an email sent to the contact bounces, the date and time of the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_reason": {"name": "email_bounced_reason", "description": "If bounce management is activated and an email sent to the contact bounces, the reason for the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The contact\u2019s fax number. Label is Business Fax.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "indicates whether the contact doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_fax": {"name": "has_opted_out_of_fax", "description": "Indicates whether the contact prohibits receiving faxes.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_email_bounced": {"name": "is_email_bounced", "description": "If bounce management is activated and an email is sent to a contact, indicates whether the email bounced (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw": {"name": "jigsaw", "description": "Data.com Key", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw contact OD", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_curequest_date": {"name": "last_curequest_date", "description": "Last Stay-in-Touch Request Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_cuupdate_date": {"name": "last_cuupdate_date", "description": "Last Stay-in-Touch Save Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country_code": {"name": "mailing_country_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_geocode_accuracy": {"name": "mailing_geocode_accuracy", "description": "Accuracy level of the geocode for the mailing address. For details on geolocation compound field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_latitude": {"name": "mailing_latitude", "description": "Used with MailingLongitude to specify the precise geolocation of a mailing address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_longitude": {"name": "mailing_longitude", "description": "Used with MailingLatitude to specify the precise geolocation of a mailing address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state_code": {"name": "mailing_state_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_city": {"name": "other_city", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_country": {"name": "other_country", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_geocode_accuracy": {"name": "other_geocode_accuracy", "description": "Accuracy level of the geocode for the other address. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_latitude": {"name": "other_latitude", "description": "Used with OtherLongitude to specify the precise geolocation of an alternate address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_longitude": {"name": "other_longitude", "description": "Used with OtherLatitude to specify the precise geolocation of an alternate address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_phone": {"name": "other_phone", "description": "Telephone for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_postal_code": {"name": "other_postal_code", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_state": {"name": "other_state", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_street": {"name": "other_street", "description": "Street for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "'Path to be combined with the URL of a Salesforce instance (Example: https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the contact. Generated URL returns an HTTP redirect (code 302) to the social network profile image for the contact. Empty if Social Accounts and Contacts isn't enabled or if Social Accounts and Contacts is disabled for the requesting user.'\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "salutation": {"name": "salutation", "description": "Honorific abbreviation, word, or phrase to be used in front of name in greetings, such as Dr. or Mrs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_data\"", "created_at": 1720572444.999638}, "source.salesforce_source.salesforce.event": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "event", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.event", "fqn": ["salesforce_source", "salesforce", "salesforce", "event"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents an event in the calendar. In the user interface, event and task records are collectively referred to as activities.", "columns": {"id": {"name": "id", "description": "Activity ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId.\nAccount Opportunity Contract Custom object that is a child of Account If the value of the WhatId field is any other object, and the value of the WhoId field is a contact object, then Salesforce uses that contact\u2019s AccountId. (If your org uses Shared Activities, Salesforce uses the AccountId of the primary contact.)\nOtherwise, Salesforce sets the value of the AccountId field to null.\nFor information on IDs, see ID Field Type.\nThis is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to true. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don\u2019t attempt to alter the timestamp to account for time zone differences. Label is Due Date Only. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to true.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date_time": {"name": "activity_date_time", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to false. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate. Label is Due Date Time. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to false.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Read-only. Available in versions 46.0 and later. This field supplies the date value that appears in the EndDateTime field. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date_time": {"name": "end_date_time", "description": "Available in versions 13.0 and later. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "event_subtype": {"name": "event_subtype", "description": "Provides standard subtypes to facilitate creating and searching for events. This field isn\u2019t updateable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_child": {"name": "is_child", "description": "Indicates whether the event is a child of another event (true) or not (false). For a child event, you can update IsReminderSet and ReminderDateTime only. You can query and delete a child event. If the objects related to the child event are different from those objects related to the parent event (this difference is possible if you use API version 25.0 or earlier) and one of the objects related to the child event is deleted, the objects related to the parent event are updated to ensure data integrity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_group_event": {"name": "is_group_event", "description": "Indicates whether the event is a group event\u2014that is, whether it has invitees (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Indicates whether users other than the creator of the event can (false) or can\u2019t (true) see the event details when viewing the event user\u2019s calendar. However, users with the View All Data or Modify All Data permission can see private events in reports and searches, or when viewing other users\u2019 calendars. Private events can\u2019t be associated with opportunities, accounts, cases, campaigns, contracts, leads, or contacts. Label is Private.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence": {"name": "is_recurrence", "description": "Indicates whether a Salesforce Classic event is scheduled to repeat itself (true) or only occurs one time (false). This field is read-only when updating records, but not when creating them. If this field value is true, then RecurrenceEndDateOnly, RecurrenceStartDateTime, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. Label is Create recurring series of events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence_2": {"name": "is_recurrence_2", "description": "Read-only. This field available in API version 44.0 and later. Indicates whether a Lightning Experience event is scheduled to repeat (true) or only occurs one time (false). If this field value is true, then Recurrence2PatternText and Recurrence2PatternVersion must be populated. Label is Repeat.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence_2_exception": {"name": "is_recurrence_2_exception", "description": "Read-only. This field available in API version 44.0 and later. Indicates whether an individual event in a Lightning Experience event series has a recurrence pattern that\u2019s different from the rest of the series, making it an exception.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence_2_exclusion": {"name": "is_recurrence_2_exclusion", "description": "Read-only. This field available in API version 44.0 and later. Indicates when updates to a Lightning Experience event series recurrence pattern have been made, but affect future event occurrences only. For past event occurrences, IsRecurrence2Exclusion is set to true, excluding past occurrences from the series recurrence pattern.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_reminder_set": {"name": "is_reminder_set", "description": "Indicates whether the activity is a reminder (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Contains the ID of the user or public calendar who owns the event. Label is Assigned to ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_start_date": {"name": "recurrence_2_pattern_start_date", "description": "Read-only. This field available in API version 44.0 and later. Indicates the date and time when the Lightning Experience event series begins. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_text": {"name": "recurrence_2_pattern_text", "description": "The RRULE that describes the recurrence pattern for Lightning Experience event series. Supports a subset of the RFC 5545 standard for internet calendaring and scheduling. See the Event Series section in this topic for usage examples. This field has a maximum length of 512 characters. This field is available in API version 44.0 and later, and has the Create property in API version 52.0 and later.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_time_zone": {"name": "recurrence_2_pattern_time_zone", "description": "This field available in API version 44.0 and later. Indicates the time zone in which the Lightning Experience event series was created or updated. This field uses standard Java TimeZone IDs. For example, America/Los_Angeles.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_version": {"name": "recurrence_2_pattern_version", "description": "Read-only. This field available in API version 44.0 and later. Indicates the standard specifications for Lightning Experience event series recurrence patterns. The only possible value is 1 (RFC 5545 v4 RRULE)\u2014RFC 5545 is a standard set of specifications for internet calendaring and scheduling that IsRecurrence2 adheres to for series recurrence patterns. RFC 5545 specifications for series recurrence patterns are called RRULES. For examples of rrule usage, see the Event Series section in this topic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_activity_id": {"name": "recurrence_activity_id", "description": "Read-only. Not required on create. Contains the ID of the main record of the Salesforce Classic recurring event. Subsequent occurrences have the same value in this field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_month": {"name": "recurrence_day_of_month", "description": "Indicates the day of the month on which the event repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_week_mask": {"name": "recurrence_day_of_week_mask", "description": "Indicates the day or days of the week on which the Salesforce Classic recurring event repeats. This field contains a bitmask. The values are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Multiple days are represented as the sum of their numerical values. For example, Tuesday and Thursday = 4 + 16 = 20.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_end_date_only": {"name": "recurrence_end_date_only", "description": "Indicates the last date on which the event repeats. For multiday Salesforce Classic recurring events, this date is the day on which the last occurrence starts. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don\u2019t attempt to alter the timestamp to account for time zone differences.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_instance": {"name": "recurrence_instance", "description": "Indicates the frequency of the Salesforce Classic event\u2019s recurrence. For example, 2nd or 3rd.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "Indicates the interval between Salesforce Classic recurring events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_month_of_year": {"name": "recurrence_month_of_year", "description": "Indicates the month in which the Salesforce Classic recurring event repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_start_date_time": {"name": "recurrence_start_date_time", "description": "Indicates the date and time when the Salesforce Classic recurring event begins. The value must precede the RecurrenceEndDateOnly. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_time_zone_sid_key": {"name": "recurrence_time_zone_sid_key", "description": "Indicates the time zone associated with a Salesforce Classic recurring event. For example, \u201cUTC-8:00\u201d for Pacific Standard Time.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_type": {"name": "recurrence_type", "description": "Indicates how often the Salesforce Classic event repeats. For example, daily, weekly, or every nth month (where \u201cnth\u201d is defined in RecurrenceInstance).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reminder_date_time": {"name": "reminder_date_time", "description": "Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. If IsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "show_as": {"name": "show_as", "description": "Indicates how this event appears when another user views the calendar: Busy, Out of Office, or Free. Label is Show Time As.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date_time": {"name": "start_date_time", "description": "Indicates the start date and time of the event. Available in versions 13.0 and later.\nIf this field has a value, then ActivityDate and ActivityDateTime must either be null or match the value of this field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available if your organization has enabled Shared Activities. Represents the count of related EventRelations pertaining to the WhatId. The count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Represents the count of related EventRelations pertaining to the WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_event_data\"", "created_at": 1720572444.999784}, "source.salesforce_source.salesforce.lead": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "lead", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.lead", "fqn": ["salesforce_source", "salesforce", "salesforce", "lead"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_lead_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a prospect or lead.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_account_id": {"name": "converted_account_id", "description": "Object reference ID that points to the account into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_contact_id": {"name": "converted_contact_id", "description": "Object reference ID that points to the contact into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_opportunity_id": {"name": "converted_opportunity_id", "description": "Object reference ID that points to the opportunity into which the lead has been converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_date": {"name": "email_bounced_date", "description": "If bounce management is activated and an email sent to the lead bounced, the date and time of the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_reason": {"name": "email_bounced_reason", "description": "If bounce management is activated and an email sent to the lead bounced, the reason for the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "Accuracy level of the geocode for the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "Indicates whether the lead doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this lead. This field is available if you enabled Data Protection and Privacy in Setup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_converted": {"name": "is_converted", "description": "Indicates whether the lead has been converted (true) or not (false). Label is Converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_unread_by_owner": {"name": "is_unread_by_owner", "description": "If true, lead has been assigned, but not yet viewed. See Unread Leads for more information. Label is Unread By Owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "'Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.'\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that was kept. If this record was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees at the lead\u2019s company. Label is Employees.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the lead\u2019s owner. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "Postal code for the address of the lead. Label is Zip/Postal Code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status code for this converted lead. Status codes are defined in Status and represented in the API by the LeadStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_lead_data\"", "created_at": 1720572444.9999318}, "source.salesforce_source.salesforce.opportunity_line_item": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "opportunity_line_item", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.opportunity_line_item", "fqn": ["salesforce_source", "salesforce", "salesforce", "opportunity_line_item"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_opportunity_line_item_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents an opportunity line item, which is a member of the list of Product2 products associated with an Opportunity.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discount": {"name": "discount", "description": "Discount for the product as a percentage. When updating these records: If you specify Discount without specifying TotalPrice, the TotalPrice is adjusted to accommodate the new Discount value, and the UnitPrice is held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system knows which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_quantity_schedule": {"name": "has_quantity_schedule", "description": "Read-only. Indicates whether a quantity schedule has been created for this object (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_revenue_schedule": {"name": "has_revenue_schedule", "description": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_schedule": {"name": "has_schedule", "description": "If either HasQuantitySchedule or HasRevenueSchedule is true, this field is also true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "list_price": {"name": "list_price", "description": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "The opportunity line item name (known as \u201cOpportunity Product\u201d in the user interface). This read-only field is available in API version 30.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_entry_id": {"name": "pricebook_entry_id", "description": "Required. ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_id": {"name": "product_2_id", "description": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later. Use the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule. When updating these records: If you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_date": {"name": "service_date", "description": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored. Product Date\u2014ServiceDate is used if not null. Schedule Date\u2014ServiceDate is used if not null and there are no revenue schedules present for this line item, that is, there are no OpportunityLineItemSchedule records with a field Type value of Revenue that are children of this record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sort_order": {"name": "sort_order", "description": "Number indicating the sort order selected by the user. Client applications can use this to match the sort order in Salesforce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem. If you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unit_price": {"name": "unit_price", "description": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price. This field or TotalPrice is required. You can\u2019t specify both.\nIf you specify Discount and Quantity, this field or TotalPrice is required.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_line_item_data\"", "created_at": 1720572445.0000482}, "source.salesforce_source.salesforce.order": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "order", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.order", "fqn": ["salesforce_source", "salesforce", "salesforce", "order"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_order_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents an order associated with a contract or an account.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Required. ID of the Account associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_by_id": {"name": "activated_by_id", "description": "ID of the User who activated this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "City for the billing address for this order. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Country for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "ISO country code for the billing address for this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_latitude": {"name": "billing_latitude", "description": "Used with BillingLongitude to specify the precise geolocation of a billing address. Acceptable values are numbers between \u201390 and 90 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_longitude": {"name": "billing_longitude", "description": "Used with BillingLatitude to specify the precise geolocation of a billing address. Acceptable values are numbers between \u2013180 and 180 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Postal code for the billing address for this order. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "State for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company_authorized_by_id": {"name": "company_authorized_by_id", "description": "ID of the user who authorized the account associated with the order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contract_id": {"name": "contract_id", "description": "ID of the contract associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "customer_authorized_by_id": {"name": "customer_authorized_by_id", "description": "ID of the contact who authorized the order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "effective_date": {"name": "effective_date", "description": "Date at which the order becomes effective. Label is Order Start Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_reduction_order": {"name": "is_reduction_order", "description": "Read-only. Determines whether an order is a reduction order. Label is Reduction Order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "Order number assigned to this order (not the unique, system-generated ID assigned during creation). Maximum size is 30 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_order_id": {"name": "original_order_id", "description": "Optional. ID of the original order that a reduction order is reducing, if the reduction order is reducing a single order. Label is Original Order. Editable only if isReductionOrder is true. If the reduction order is reducing more than one order, leave blank. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Required. ID of the User or queue that owns this order. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Required. ID of the price book associated with this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_latitude": {"name": "shipping_latitude", "description": "Used with ShippingLongitude to specify the precise geolocation of a shipping address. Acceptable values are numbers between \u201390 and 90 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address. Acceptable values are numbers between \u2013180 and 180 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Postal code of the shipping address. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Picklist of values that indicate order status. Each value is within one of two status categories defined in StatusCode. For example, the status picklist might contain Draft, Ready for Review, and Ready for Activation values with a StatusCode of Draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status_code": {"name": "status_code", "description": "The status category for the order. An order can be either Draft or Activated. Label is Status Category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_amount": {"name": "total_amount", "description": "The total amount for the order products associated with this order. This field is available in API v48.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "If you want to show more information about your order, you can add custom values to the Type picklist. By default, the Type field doesn't perform any actions or show any values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_order_data\"", "created_at": 1720572445.0002072}, "source.salesforce_source.salesforce.product_2": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "product_2", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.product_2", "fqn": ["salesforce_source", "salesforce", "salesforce", "product_2"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_product_2_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a product that your company sells.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "A text description of this record. Label is Product Description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_url": {"name": "display_url", "description": "URL leading to a specific version of a record in the linked external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_id": {"name": "external_id", "description": "The unique identifier of a record in the linked external data source. For example, ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "family": {"name": "family", "description": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether this record is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Default name of this record. Label is Product Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_quantity_installments": {"name": "number_of_quantity_installments", "description": "If the product has a quantity schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_revenue_installments": {"name": "number_of_revenue_installments", "description": "If the product has a revenue schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "Default product code for this record. Your org defines the product code naming pattern.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_installment_period": {"name": "quantity_installment_period", "description": "If the product has a quantity schedule, the amount of time covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_schedule_type": {"name": "quantity_schedule_type", "description": "The type of the quantity schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit_of_measure": {"name": "quantity_unit_of_measure", "description": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_installment_period": {"name": "revenue_installment_period", "description": "If the product has a revenue schedule, the time period covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_schedule_type": {"name": "revenue_schedule_type", "description": "The type of the revenue schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stock_keeping_unit": {"name": "stock_keeping_unit", "description": "The SKU for the product. Use in tandem with or instead of the ProductCode field. For example, you can track the manufacturer\u2019s identifying code in the Product Code field and assign the product a SKU when you resell it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_product_2_data\"", "created_at": 1720572445.000323}, "source.salesforce_source.salesforce.task": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "task", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.task", "fqn": ["salesforce_source", "salesforce", "salesforce", "task"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_task_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a business activity such as making a phone call or other to-do items. In the user interface, Task and Event records are collectively referred to as activities.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related Account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId. Account Opportunity Contract Custom object that is a child of Account If the value of the WhatIdfield is any other object, and the value of the WhoId field is a Contact object, then Salesforce uses that contact\u2019s AccountId. (If your organization uses Shared Activities, then Salesforce uses the AccountId of the primary contact.) Otherwise, Salesforce sets the value of the AccountId field to null. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Represents the due date of the task. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. Label is Due Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_disposition": {"name": "call_disposition", "description": "Represents the result of a given call, for example, \u201cwe'll call back,\u201d or \u201ccall unsuccessful.\u201d Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_duration_in_seconds": {"name": "call_duration_in_seconds", "description": "Duration of the call in seconds. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_object": {"name": "call_object", "description": "Name of a call center. Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "completed_date_time": {"name": "completed_date_time", "description": "The date and time the task was saved with a Closed status. For insert, if the task is saved with a Closed status the field is set. If the task is saved with an Open status the field is set to NULL. For update, if the task is saved with a new Closed status, the field is reset. If the task is saved with a new non-closed status, the field is reset to NULL. If the task is saved with the same closed status (that is, unchanged) there is no change to the field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Indicates whether the task has been completed (true) or not (false). Is only set indirectly via the Status picklist. Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_high_priority": {"name": "is_high_priority", "description": "Indicates a high-priority task. This field is derived from the Priority field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence": {"name": "is_recurrence", "description": "Indicates whether the task is scheduled to repeat itself (true) or only occurs once (false). This field is read-only on update, but not on create. If this field value is true, then RecurrenceStartDateOnly, RecurrenceEndDateOnly, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. See Recurring Tasks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_reminder_set": {"name": "is_reminder_set", "description": "Indicates whether a popup reminder has been set for the task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User or Group who owns the record. Label is Assigned To ID. This field accepts Groups of type Queue only. In the user interface, Group IDs correspond with the queue\u2019s list view names. To create or update tasks assigned to Group, use v48.0 or later. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "priority": {"name": "priority", "description": "Required. Indicates the importance or urgency of a task, such as high or low.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_activity_id": {"name": "recurrence_activity_id", "description": "Read-only. Not required on create. ID of the main record of the recurring task. Subsequent occurrences have the same value in this field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_month": {"name": "recurrence_day_of_month", "description": "The day of the month in which the task repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_week_mask": {"name": "recurrence_day_of_week_mask", "description": "The day or days of the week on which the task repeats. This field contains a bitmask. The values are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Multiple days are represented as the sum of their numerical values. For example, Tuesday and Thursday = 4 + 16 = 20.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_end_date_only": {"name": "recurrence_end_date_only", "description": "The last date on which the task repeats. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. ", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_instance": {"name": "recurrence_instance", "description": "The frequency of the recurring task. Possible values are: First\u20141st Fourth\u20144th Last\u2014last Second\u20142nd Third\u20143rd", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "The interval between recurring tasks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_month_of_year": {"name": "recurrence_month_of_year", "description": "The month of the year in which the task repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_regenerated_type": {"name": "recurrence_regenerated_type", "description": "Represents what triggers a repeating task to repeat. Add this field to a page layout together with the RecurrenceInterval field, which determines the number of days between the triggering date (due date or close date) and the due date of the next repeating task in the series. Label is Repeat This Task. This field has the following picklist values: None: The task doesn\u2019t repeat. After due date: The next repeating task will be due the specified number of days after the current task\u2019s due date. After the task is closed: The next repeating task will be due the specified number of days after the current task is closed. (Task closed): This task, now closed, was opened as part of a repeating series. ", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_start_date_only": {"name": "recurrence_start_date_only", "description": "The date when the recurring task begins. Must be a date and time before RecurrenceEndDateOnly.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_time_zone_sid_key": {"name": "recurrence_time_zone_sid_key", "description": "The time zone associated with the recurring task. For example, \u201cUTC-8:00\u201d for Pacific Standard Time.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_type": {"name": "recurrence_type", "description": "Indicates how often the task repeats. For example, daily, weekly, or every nth month (where \u201cnth\u201d is defined in RecurrenceInstance).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reminder_date_time": {"name": "reminder_date_time", "description": "Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. If IsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Required. The status of the task, such as In Progress or Completed. Each predefined Status field implies a value for the IsClosed flag. To obtain picklist values, query the TaskStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the task, such as \u201cCall\u201d or \u201cSend Quote.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "task_subtype": {"name": "task_subtype", "description": "Provides standard subtypes to facilitate creating and searching for specific task subtypes.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhatId. Count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID. If Shared Activities is enabled, the value of this field is the ID of the related lead or primary contact. If you add, update, or remove the WhoId field, you might encounter problems with triggers, workflows, and data validation rules that are associated with the record. The label is Name ID. Beginning in API version 37.0, if the contact or lead ID in the WhoId field is not in the TaskWhoIds list, no error occurs and the ID is added to the TaskWhoIds as the primary WhoId. If WhoId is set to null, an arbitrary ID from the existing TaskWhoIds list is promoted to the primary position.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"sf_task_data\"", "created_at": 1720572445.000458}, "source.salesforce_source.salesforce.fivetran_formula": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "fivetran_formula", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.fivetran_formula", "fqn": ["salesforce_source", "salesforce", "salesforce", "fivetran_formula"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "fivetran_formula", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Holds the formula fields for each of your custom fields", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"fivetran_formula\"", "created_at": 1720572445.000542}, "source.salesforce_source.salesforce.fivetran_formula_model": {"database": "postgres", "schema": "zz_dbt_catherine_sf", "name": "fivetran_formula_model", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.fivetran_formula_model", "fqn": ["salesforce_source", "salesforce", "salesforce", "fivetran_formula_model"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "fivetran_formula_model", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Holds the formula fields for each of your salesforce objects as a single select statement", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"fivetran_formula_model\"", "created_at": 1720572445.000625}}, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2542248, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2544472, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.254563, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.254673, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.254789, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2563682, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2567239, "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 with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v', 'm')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2573922, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2575161, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.266418, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2669, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.267203, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2675068, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.267966, "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 {% 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.268457, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2686238, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.268959, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.269342, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2701209, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.27031, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.270611, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.270871, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.27128, "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 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.27149, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.272053, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.272249, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.272359, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.272532, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.27267, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.273034, "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 update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.273731, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2738712, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.274152, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.274286, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.274452, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2753868, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.275889, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.276175, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.276598, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2767339, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2773938, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2775638, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.277691, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.278217, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2783842, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.27859, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.279187, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2823591, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.282511, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.282988, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.283375, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.284405, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.284589, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2847302, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.284867, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2849998, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2853582, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.285642, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2859251, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.286356, "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 merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.2866151, "supported_languages": null}, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.29009, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.290257, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.290464, "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, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\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 }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\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 }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.291138, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.291297, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.291463, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.292775, "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, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', 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_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\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 }) %}\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.294065, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.298181, "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 }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.2984488, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.29861, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.298696, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.2988338, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.298948, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.299146, "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\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_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\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.299982, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.300164, "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\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.300405, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.300808, "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 {%- set config = model['config'] -%}\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 {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", 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 final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\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 missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\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', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\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 {% 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.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.306679, "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\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 {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\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 %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\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 {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3092859, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.310405, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.310698, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3108978, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.31147, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.311837, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.312194, "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\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 {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3138602, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.318697, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.319065, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3193011, "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 ~ \"`\") }}\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 ~ \"`\") }}\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3205671, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.320789, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.321404, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.32414, "supported_languages": ["sql"]}, "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 -- 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 {% do create_indexes(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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3268852, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3284569, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.328964, "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\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.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.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}, "patch_path": null, "arguments": [], "created_at": 1720572443.32958, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.329807, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3304892, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.336797, "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 unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.338347, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3386, "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 sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.339544, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3398001, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.340414, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.341007, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.341861, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.342083, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.34226, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3425448, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.342724, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3430028, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.343182, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.343434, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3436108, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.343755, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3440158, "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 {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\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_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\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 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 {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\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.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.348743, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.354273, "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\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.355412, "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\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\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 {%- 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 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.35654, "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\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.357339, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.357569, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.357684, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.357963, "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 }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.3580952, "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\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 ~ \" 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 {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\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 {% 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.361593, "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)) }}\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 = load_csv_rows(model, agate_table) %}\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.364647, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.369646, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.37049, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.370715, "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 %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.371161, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3713439, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.37147, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.371607, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.371718, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.37187, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3719811, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3724248, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3726, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3739011, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.374314, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3746712, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.375173, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.375419, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.37569, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.376073, "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 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.376313, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3769972, "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 }} 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3773499, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.377526, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.377713, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3779001, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.378655, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.379842, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.38021, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.380446, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.380702, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3809059, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.38121, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.381407, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.382088, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.382497, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.382694, "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 }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.382957, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.383289, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.383546, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.384, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3844202, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.384733, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.384929, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3851678, "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 }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.38527, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.385532, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.385738, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3860328, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.386165, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3864279, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.38657, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3871622, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.387339, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.387608, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3877518, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.388015, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.388153, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3891242, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.389239, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3897312, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.389887, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3900201, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3912761, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.39164, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3919601, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.392201, "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 }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.392303, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.392559, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3926988, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.392956, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.393093, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.39392, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3940969, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.394506, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.395149, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.395584, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3957582, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3959281, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3961759, "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 }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.396275, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.397111, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.397252, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.398379, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3985689, "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 ~ \" 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3987782, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3990378, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.399177, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3995688, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.399727, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.3999062, "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 }}\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.400304, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.400645, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.400925, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.401161, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4017038, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4030988, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.40364, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.40391, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4057028, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.406877, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.407579, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4078012, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4080179, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.408094, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.408824, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4093802, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4096, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4099488, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4102669, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.410534, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.410846, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4110012, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.411231, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.41135, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4121568, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4125419, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.412717, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4132009, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.413447, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.413548, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.413868, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4140952, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.41431, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4143848, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.41463, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.414764, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.415041, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4151711, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.415787, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.416176, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.416497, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4166532, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4169228, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.417055, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.417299, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.417451, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.417681, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4178271, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4180858, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.41821, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4184399, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.418603, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.418874, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.419007, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4192362, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.419337, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.420251, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.420395, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4205492, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.420696, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4208481, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.420992, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.421144, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.42131, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4214652, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4216058, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.421758, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.421898, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.42205, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.422187, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.422452, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.42264, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.422873, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.422975, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.423297, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4235442, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.423682, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.42419, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4243462, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4245608, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.424821, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4249501, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.425311, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.425549, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.425826, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.425956, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.426326, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.426501, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4266539, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4268212, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.427286, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.427493, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4276328, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.427736, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.427891, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.427967, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.428124, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.428283, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.429099, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4292312, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.429384, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.429756, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.429931, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.430063, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.430211, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.430331, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.432283, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.43244, "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 {{ 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4326458, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.43292, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4332201, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.433517, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.433692, "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 }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.433845, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.43408, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.434602, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4348202, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.434956, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.435356, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.435742, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.436011, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.436233, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.437909, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.43802, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.438178, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.438288, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.438613, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.438821, "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 }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.438922, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.439133, "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 }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.439379, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.439593, "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 revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.439771, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4399848, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.440622, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.440802, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.441036, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.441254, "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 ~': 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.442312, "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 -%}\n {{ sql_header }}\n {%- endif -%}\n {%- if limit is not none -%}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n {%- else -%}\n {{ compiled_code }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.442817, "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": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.4429948, "supported_languages": null}, "macro.dbt.default__get_limit_subquery_sql": {"name": "default__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.default__get_limit_subquery_sql", "macro_sql": "{% macro default__get_limit_subquery_sql(sql, limit) %}\n select *\n from (\n {{ sql }}\n ) as model_limit_subq\n limit {{ limit }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.443129, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.443778, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.443934, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4441228, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4442801, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4445372, "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 {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.445209, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4480572, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.448297, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4484851, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.448725, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4489, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.449049, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.449217, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.449449, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.449642, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4499252, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4501, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.45025, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.450407, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.450549, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4507399, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.450899, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.453102, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.45325, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.453604, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.453813, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4540071, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.454176, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.455269, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.455595, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.455772, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.456102, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4563148, "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 }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4568698, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.457116, "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 }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.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.name }}{{ ',' 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.457838, "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{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\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\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 }}{% 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 }}{% 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.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.461, "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) %}\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 }}{% 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.461622, "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 {#-- 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 -%}", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.462688, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.464342, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4644961, "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 {%- 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.465272, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4656699, "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 -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.466218, "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\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.466671, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4667451, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.467263, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.467503, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.467799, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.468081, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.468425, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.468883, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.469357, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.46997, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4702752, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.470589, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.471652, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.472687, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.47353, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.474538, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.475188, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.475515, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.476214, "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 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\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.476995, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4774249, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.477857, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.478444, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4788952, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4794261, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.479789, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.480436, "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 where {{ column_name }} is not null\n limit 1\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}, "patch_path": null, "arguments": [], "created_at": 1720572443.481171, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.481772, "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 {% set column_list = 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4824362, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.482979, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.483304, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.483683, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.484023, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.48465, "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 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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.485417, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.486303, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.487157, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.489047, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.492747, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.493261, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.493547, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.497081, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4985092, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4987679, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.498927, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.499337, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.4995992, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.499779, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5000188, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.500179, "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{#- 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5007548, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.501534, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.502223, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5027719, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.502992, "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 1) - 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5033338, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.503724, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5043, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.504597, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.504917, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.505572, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5063648, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.507195, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5075772, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.507757, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.508244, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.508898, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.509697, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5100842, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5103538, "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) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.511581, "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) -%}\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 {%- 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 }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.512961, "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') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.514273, "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') -%}\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 select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.515755, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5160341, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.516169, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5193338, "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) }} 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 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}, "patch_path": null, "arguments": [], "created_at": 1720572443.522557, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.522847, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5230799, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.523948, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.524159, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.524323, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5245051, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.524665, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.524825, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.524987, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.525364, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.525602, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.525964, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.526468, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.526792, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.527105, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5303261, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.530677, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.531369, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.532048, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.532524, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.533621, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.535035, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5360708, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5368588, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5373042, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.537992, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.53877, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.539212, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5393941, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5397608, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5403142, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.540759, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.54135, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.541875, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.542009, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5421472, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.542281, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.542773, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.543519, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.544584, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.544847, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.545367, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5461252, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.551275, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.551926, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.552758, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.553443, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5541189, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.555016, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5551841, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.555292, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.558055, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5656152, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.565751, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.565823, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5663722, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\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=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5678878, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.568201, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.568463, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.568723, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5690298, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5692532, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.5694458, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.569814, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5707479, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5709069, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5710661, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5712268, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.571365, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.571522, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.572327, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.57293, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.574255, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5744908, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.574722, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5749528, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.57518, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5754292, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.575676, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.575899, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5762072, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.576308, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.576403, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5765, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5768461, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.577516, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.578512, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.57906, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.579804, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5802612, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.580393, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.580522, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.580645, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.580775, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5837271, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5838861, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.584042, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.584191, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.585828, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.586755, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.586891, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.587151, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.587424, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5875509, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.58767, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5877929, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.587913, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.588385, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.588923, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5894048, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.589602, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.589814, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.590058, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.591147, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.594937, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5952861, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.595635, "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\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.597151, "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 %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.59768, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.598237, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5983841, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5985332, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.598698, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.5988421, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.598988, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.599803, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6010659, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6017852, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6019452, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.602103, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6022668, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6024199, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.602586, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6028259, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6029272, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.603023, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6036422, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.605002, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.605173, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6059608, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.609493, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.613916, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6152709, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.615608, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6157591, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.615954, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.616292, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.616404, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.616516, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.616617, "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 -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.616713, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.616961, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.6170602, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.617163, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.617565, "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}, "patch_path": null, "arguments": [], "created_at": 1720572443.617941, "supported_languages": null}, "macro.salesforce.custom_persist_pass_through_columns": {"name": "custom_persist_pass_through_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/custom_persist_pass_through_columns.sql", "original_file_path": "macros/custom_persist_pass_through_columns.sql", "unique_id": "macro.salesforce.custom_persist_pass_through_columns", "macro_sql": "{% macro custom_persist_pass_through_columns(pass_through_variable, identifier=none, transform='', append_string='') %}\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 }}{{ append_string }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.618596, "supported_languages": null}, "macro.salesforce_source.get_contact_columns": {"name": "get_contact_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_contact_columns.sql", "original_file_path": "macros/get_contact_columns.sql", "unique_id": "macro.salesforce_source.get_contact_columns", "macro_sql": "{% macro get_contact_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"department\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"home_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"individual_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"lead_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"master_record_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"reports_to_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__contact_pass_through_columns')) }} \n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.622145, "supported_languages": null}, "macro.salesforce_source.get_account_columns": {"name": "get_account_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_account_columns.sql", "original_file_path": "macros/get_account_columns.sql", "unique_id": "macro.salesforce_source.get_account_columns", "macro_sql": "{% macro get_account_columns() %}\n\n{% set columns = [\n\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"account_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt.type_float()},\n {\"name\": \"billing_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"master_record_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_employees\", \"datatype\": dbt.type_int()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ownership\", \"datatype\": dbt.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"rating\", \"datatype\": dbt.type_string()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"website\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__account_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.6260219, "supported_languages": null}, "macro.salesforce_source.coalesce_rename": {"name": "coalesce_rename", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/coalesce_rename.sql", "original_file_path": "macros/coalesce_rename.sql", "unique_id": "macro.salesforce_source.coalesce_rename", "macro_sql": "{% macro coalesce_rename(\n column_key,\n column_dict,\n original_column_name=column_dict[column_key][\"name\"],\n datatype=column_dict[column_key][\"datatype\"],\n alias=column_dict[column_key][\"alias\"] | default(original_column_name),\n renamed_column_name=column_dict[column_key][\"renamed_column_name\"]\n ) %}\n\n{# This macro accomodates Fivetran connectors that keep the original salesforce field naming conventions without underscores #}\n{%- if original_column_name|lower == renamed_column_name|lower %}\n cast({{ renamed_column_name }} as {{ datatype }}) as {{ alias }}\n\n{%- else %}\n coalesce(cast({{ renamed_column_name }} as {{ datatype }}),\n cast({{ original_column_name }} as {{ datatype }}))\n as {{ alias }}\n\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.62676, "supported_languages": null}, "macro.salesforce_source.get_task_columns": {"name": "get_task_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_task_columns.sql", "original_file_path": "macros/get_task_columns.sql", "unique_id": "macro.salesforce_source.get_task_columns", "macro_sql": "{% macro get_task_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"call_disposition\", \"datatype\": dbt.type_string()},\n {\"name\": \"call_duration_in_seconds\", \"datatype\": dbt.type_int()},\n {\"name\": \"call_object\", \"datatype\": dbt.type_string()},\n {\"name\": \"call_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"completed_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"is_closed\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_high_priority\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"priority\", \"datatype\": dbt.type_string()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"task_subtype\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"what_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"what_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"who_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"who_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__task_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.629955, "supported_languages": null}, "macro.salesforce_source.get_user_role_columns": {"name": "get_user_role_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_user_role_columns.sql", "original_file_path": "macros/get_user_role_columns.sql", "unique_id": "macro.salesforce_source.get_user_role_columns", "macro_sql": "{% macro get_user_role_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"developer_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"opportunity_access_for_account_owner\", \"datatype\": dbt.type_string()},\n {\"name\": \"parent_role_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"rollup_description\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__user_role_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_boolean", "macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.631114, "supported_languages": null}, "macro.salesforce_source.get_order_columns": {"name": "get_order_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_order_columns.sql", "original_file_path": "macros/get_order_columns.sql", "unique_id": "macro.salesforce_source.get_order_columns", "macro_sql": "{% macro get_order_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activated_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activated_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"billing_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"contract_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"end_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"opportunity_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"order_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"original_order_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"pricebook_2_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"total_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__order_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_float", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.635318, "supported_languages": null}, "macro.salesforce_source.get_user_columns": {"name": "get_user_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_user_columns.sql", "original_file_path": "macros/get_user_columns.sql", "unique_id": "macro.salesforce_source.get_user_columns", "macro_sql": "{% macro get_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"alias\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"company_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"department\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"individual_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_active\", \"datatype\": \"boolean\"},\n {\"name\": \"last_login_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"manager_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"profile_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"street\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_role_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"username\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__user_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_boolean", "macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.638679, "supported_languages": null}, "macro.salesforce_source.get_product_2_columns": {"name": "get_product_2_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_product_2_columns.sql", "original_file_path": "macros/get_product_2_columns.sql", "unique_id": "macro.salesforce_source.get_product_2_columns", "macro_sql": "{% macro get_product_2_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"display_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"external_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"family\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_active\", \"datatype\": \"boolean\"},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_quantity_installments\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_revenue_installments\", \"datatype\": dbt.type_int()},\n {\"name\": \"product_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity_installment_period\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity_schedule_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity_unit_of_measure\", \"datatype\": dbt.type_string()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"revenue_installment_period\", \"datatype\": dbt.type_string()},\n {\"name\": \"revenue_schedule_type\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__product_2_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.6415172, "supported_languages": null}, "macro.salesforce_source.column_list_to_dict": {"name": "column_list_to_dict", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/column_list_to_dict.sql", "original_file_path": "macros/column_list_to_dict.sql", "unique_id": "macro.salesforce_source.column_list_to_dict", "macro_sql": "{% macro column_list_to_dict(column_list) %}\n\n {%- set column_dict = {} -%}\n {%- for col in column_list -%}\n {%- do column_dict.update({col.name: col}) if not col.is_rename -%}\n {%- endfor -%}\n {{ return(column_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.641902, "supported_languages": null}, "macro.salesforce_source.get_opportunity_columns": {"name": "get_opportunity_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_opportunity_columns.sql", "original_file_path": "macros/get_opportunity_columns.sql", "unique_id": "macro.salesforce_source.get_opportunity_columns", "macro_sql": "{% macro get_opportunity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": \"boolean\"},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"close_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"expected_revenue\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"fiscal\", \"datatype\": dbt.type_string()},\n {\"name\": \"fiscal_quarter\", \"datatype\": dbt.type_int()},\n {\"name\": \"fiscal_year\", \"datatype\": dbt.type_int()},\n {\"name\": \"forecast_category\", \"datatype\": dbt.type_string()},\n {\"name\": \"forecast_category_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"has_open_activity\", \"datatype\": \"boolean\"},\n {\"name\": \"has_opportunity_line_item\", \"datatype\": \"boolean\"},\n {\"name\": \"has_overdue_task\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_closed\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_won\", \"datatype\": \"boolean\"},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"lead_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"next_step\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"probability\", \"datatype\": dbt.type_float()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"stage_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"synced_quote_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__opportunity_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.645422, "supported_languages": null}, "macro.salesforce_source.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_event_columns.sql", "original_file_path": "macros/get_event_columns.sql", "unique_id": "macro.salesforce_source.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"activity_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"end_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"end_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"event_subtype\", \"datatype\": dbt.type_string()},\n {\"name\": \"group_event_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"is_child\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_group_event\", \"datatype\": \"boolean\"},\n {\"name\": \"is_recurrence\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"location\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"start_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"what_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"what_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"who_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"who_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__event_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.648509, "supported_languages": null}, "macro.salesforce_source.get_lead_columns": {"name": "get_lead_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_lead_columns.sql", "original_file_path": "macros/get_lead_columns.sql", "unique_id": "macro.salesforce_source.get_lead_columns", "macro_sql": "{% macro get_lead_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt.type_float()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"converted_account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"converted_contact_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"converted_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"converted_opportunity_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_bounced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email_bounced_reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"has_opted_out_of_email\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"individual_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_converted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_unread_by_owner\", \"datatype\": \"boolean\"},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"lead_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"master_record_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_employees\", \"datatype\": dbt.type_int()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"street\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"website\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__lead_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_float", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.653565, "supported_languages": null}, "macro.salesforce_source.get_opportunity_line_item_columns": {"name": "get_opportunity_line_item_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_opportunity_line_item_columns.sql", "original_file_path": "macros/get_opportunity_line_item_columns.sql", "unique_id": "macro.salesforce_source.get_opportunity_line_item_columns", "macro_sql": "{% macro get_opportunity_line_item_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"discount\", \"datatype\": dbt.type_float()},\n {\"name\": \"has_quantity_schedule\", \"datatype\": \"boolean\"},\n {\"name\": \"has_revenue_schedule\", \"datatype\": \"boolean\"},\n {\"name\": \"has_schedule\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"list_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"opportunity_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"pricebook_entry_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"product_2_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"product_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity\", \"datatype\": dbt.type_float()},\n {\"name\": \"service_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"sort_order\", \"datatype\": dbt.type_int()},\n {\"name\": \"total_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"unit_price\", \"datatype\": dbt.type_float()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__opportunity_line_item_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.656368, "supported_languages": null}, "macro.salesforce_source.add_renamed_columns": {"name": "add_renamed_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/add_renamed_columns.sql", "original_file_path": "macros/add_renamed_columns.sql", "unique_id": "macro.salesforce_source.add_renamed_columns", "macro_sql": "{% macro add_renamed_columns(column_list) %}\n\n{%- set renamed_columns = [] %}\n\n{%- for col in column_list %}\n {# Use the alias if it is provided. #}\n {%- set original_column_name = col.name %}\n\n {%- if 'fivetran' not in original_column_name %}\n {# Use renamed_column_name value if it provided in the get_columns macro #}\n {%- set renamed_column_name = col.renamed_column_name | default(original_column_name.split('_') | map('capitalize') | join('')) %}\n\n {# Add an entry to the list of renames to populate the filled columns if the rename is different #}\n {%- do renamed_columns.append({\"name\": renamed_column_name, \"datatype\": col.datatype, \"is_rename\": true}) if renamed_column_name|lower != original_column_name|lower %}\n\n {# Update the original column with the renamed column name for use later. #}\n {%- set col = col.update({ \"renamed_column_name\": renamed_column_name, \"is_rename\": false}) %}\n {%- endif %}\n{%- endfor %}\n\n{%- do column_list.extend(renamed_columns) %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1720572443.6573088, "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.salesforce.avg_bookings_amount": {"name": "avg_bookings_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_bookings_amount", "block_contents": "The average opportunity amount, if status is won."}, "doc.salesforce.avg_days_open": {"name": "avg_days_open", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_days_open", "block_contents": "The average days since created across opportunties in the pipeline."}, "doc.salesforce.avg_days_to_close": {"name": "avg_days_to_close", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_days_to_close", "block_contents": "The average days to close across opportunties in that have been won."}, "doc.salesforce.avg_pipeline_opp_amount": {"name": "avg_pipeline_opp_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_pipeline_opp_amount", "block_contents": "The average opportunity amount, if status is pipeline."}, "doc.salesforce.bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_amount_closed_this_month", "block_contents": "The opportunity amount, if closed this month and status is won."}, "doc.salesforce.bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_amount_closed_this_quarter", "block_contents": "The opportunity amount, if closed this quarter and status is won."}, "doc.salesforce.bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_count_closed_this_month", "block_contents": "The opportunity count, if closed this month and status is won."}, "doc.salesforce.bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_count_closed_this_quarter", "block_contents": "The opportunity count, if closed this quarter and status is won."}, "doc.salesforce.largest_booking": {"name": "largest_booking", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.largest_booking", "block_contents": "The largest amount associated with a single opportunity."}, "doc.salesforce.largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.largest_deal_in_pipeline", "block_contents": "The largest amount associated with a single opportunity in the current pipeline."}, "doc.salesforce.lost_amount_this_month": {"name": "lost_amount_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_amount_this_month", "block_contents": "The opportunity amount, if closed this month and status is lost."}, "doc.salesforce.lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_amount_this_quarter", "block_contents": "The opportunity amount, if closed this quarter and status is lost."}, "doc.salesforce.lost_count_this_month": {"name": "lost_count_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_count_this_month", "block_contents": "The opportunity count, if closed this month and status is lost."}, "doc.salesforce.lost_count_this_quarter": {"name": "lost_count_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_count_this_quarter", "block_contents": "The opportunity count, if closed this quarter and status is lost."}, "doc.salesforce.owner_id": {"name": "owner_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.owner_id", "block_contents": "Id of the owner of this opportunity"}, "doc.salesforce.pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_count_created_this_month", "block_contents": "The opportunity count, if closed this month and status is pipeline."}, "doc.salesforce.pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_count_created_this_quarter", "block_contents": "The opportunity count, if closed this quarter and status is pipeline."}, "doc.salesforce.pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_amount_this_month", "block_contents": "The opportunity amount, if closed this month and status is pipeline."}, "doc.salesforce.pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_amount_this_quarter", "block_contents": "The opportunity amount, if closed this quarter and status is pipeline."}, "doc.salesforce.pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_forecast_amount_this_month", "block_contents": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline."}, "doc.salesforce.pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_forecast_amount_this_quarter", "block_contents": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline."}, "doc.salesforce.total_bookings_amount": {"name": "total_bookings_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_bookings_amount", "block_contents": "The opportunity amount, if status is won."}, "doc.salesforce.total_lost_amount": {"name": "total_lost_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_lost_amount", "block_contents": "The opportunity amount, if status is lost."}, "doc.salesforce.total_number_bookings": {"name": "total_number_bookings", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_number_bookings", "block_contents": "The opportunity count, if status is won."}, "doc.salesforce.total_number_lost": {"name": "total_number_lost", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_number_lost", "block_contents": "The opportunity count, if status is lost."}, "doc.salesforce.total_number_pipeline": {"name": "total_number_pipeline", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_number_pipeline", "block_contents": "The opportunity count, if status is pipeline."}, "doc.salesforce.total_pipeline_amount": {"name": "total_pipeline_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_pipeline_amount", "block_contents": "The opportunity amount, if status is pipeline."}, "doc.salesforce.total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_pipeline_forecast_amount", "block_contents": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline."}, "doc.salesforce.total_win_percent": {"name": "total_win_percent", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_win_percent", "block_contents": "The booking amount closed, divided by the sum of the booking amount and the lost amount.."}, "doc.salesforce.win_percent_this_month": {"name": "win_percent_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.win_percent_this_month", "block_contents": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month."}, "doc.salesforce.win_percent_this_quarter": {"name": "win_percent_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.win_percent_this_quarter", "block_contents": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter."}, "doc.salesforce.contact_id": {"name": "contact_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_id", "block_contents": "Unique contact ID."}, "doc.salesforce.contact_name": {"name": "contact_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_name", "block_contents": "Name of contact."}, "doc.salesforce.account_id": {"name": "account_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_id", "block_contents": "ID of contact's account."}, "doc.salesforce.department": {"name": "department", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.department", "block_contents": "The contact\u2019s department."}, "doc.salesforce.contact_description": {"name": "contact_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_description", "block_contents": "A description of the contact."}, "doc.salesforce.email": {"name": "email", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.email", "block_contents": "The contact\u2019s email address."}, "doc.salesforce.individual_id": {"name": "individual_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.individual_id", "block_contents": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field."}, "doc.salesforce.contact_is_deleted": {"name": "contact_is_deleted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_is_deleted", "block_contents": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "doc.salesforce.last_activity_date": {"name": "last_activity_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.last_activity_date", "block_contents": "Value is the most recent of either:\nDue date of the most recent event logged against the record.\nDue date of the most recently closed task associated with the record."}, "doc.salesforce.lead_source": {"name": "lead_source", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lead_source", "block_contents": "The lead\u2019s source."}, "doc.salesforce.mailing_city": {"name": "mailing_city", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_city", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_country": {"name": "mailing_country", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_country", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_country_code": {"name": "mailing_country_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_country_code", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_postal_code": {"name": "mailing_postal_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_postal_code", "block_contents": "The ISO codes for the mailing address\u2019s state and country."}, "doc.salesforce.mailing_state": {"name": "mailing_state", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_state", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_state_code": {"name": "mailing_state_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_state_code", "block_contents": "The ISO codes for the mailing address\u2019s state and country."}, "doc.salesforce.mailing_street": {"name": "mailing_street", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_street", "block_contents": "Street address for mailing address."}, "doc.salesforce.master_record_id": {"name": "master_record_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.master_record_id", "block_contents": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null."}, "doc.salesforce.mobile_phone": {"name": "mobile_phone", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mobile_phone", "block_contents": "Contact\u2019s mobile phone number."}, "doc.salesforce.contact_owner_id": {"name": "contact_owner_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_owner_id", "block_contents": "The ID of the owner of the account associated with this contact."}, "doc.salesforce.phone": {"name": "phone", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.phone", "block_contents": "Telephone number for the contact. Label is Business Phone."}, "doc.salesforce.reports_to_id": {"name": "reports_to_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.reports_to_id", "block_contents": "This field doesn\u2019t appear if IsPersonAccount is true.\nThis is a relationship field."}, "doc.salesforce.contact_owner_name": {"name": "contact_owner_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_owner_name", "block_contents": "Name of owner of the account associated with this contact."}, "doc.salesforce.account_name": {"name": "account_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_name", "block_contents": "Name of the account."}, "doc.salesforce.account_number": {"name": "account_number", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_number", "block_contents": "Account number assigned to this account (not the unique, system-generated ID assigned during creation)."}, "doc.salesforce.account_source": {"name": "account_source", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_source", "block_contents": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "doc.salesforce.account_annual_revenue": {"name": "account_annual_revenue", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_annual_revenue", "block_contents": "Estimated annual revenue of the account."}, "doc.salesforce.account_description": {"name": "account_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_description", "block_contents": "Text description of the account."}, "doc.salesforce.account_industry": {"name": "account_industry", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_industry", "block_contents": "An industry associated with this account."}, "doc.salesforce.account_is_deleted": {"name": "account_is_deleted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_is_deleted", "block_contents": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "doc.salesforce.account_number_of_employees": {"name": "account_number_of_employees", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_number_of_employees", "block_contents": "Number of employees working at the company represented by this account."}, "doc.salesforce.account_owner_id": {"name": "account_owner_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_owner_id", "block_contents": "The ID of the user who currently owns this account."}, "doc.salesforce.account_parent_id": {"name": "account_parent_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_parent_id", "block_contents": "ID of the account parent object, if any."}, "doc.salesforce.account_rating": {"name": "account_rating", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_rating", "block_contents": "The account\u2019s prospect rating, for example Hot, Warm, or Cold."}, "doc.salesforce.account_type": {"name": "account_type", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_type", "block_contents": "Type of account, for example, Customer, Competitor, or Partner."}, "doc.salesforce.date_day": {"name": "date_day", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.date_day", "block_contents": "Day of event, in UTC."}, "doc.salesforce.leads_created": {"name": "leads_created", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.leads_created", "block_contents": "Number of leads created on that date."}, "doc.salesforce.leads_converted": {"name": "leads_converted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.leads_converted", "block_contents": "Number of leads converted on that date."}, "doc.salesforce.tasks_completed": {"name": "tasks_completed", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.tasks_completed", "block_contents": "Number of tasks for that activity date."}, "doc.salesforce.events_completed": {"name": "events_completed", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.events_completed", "block_contents": "Number of events for that activity date."}, "doc.salesforce.opportunities_created": {"name": "opportunities_created", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_created", "block_contents": "Number of opportunities created on that date."}, "doc.salesforce.opportunities_won": {"name": "opportunities_won", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_won", "block_contents": "Number of opportunities won on that close date."}, "doc.salesforce.opportunities_lost": {"name": "opportunities_lost", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_lost", "block_contents": "Number of opportunities lost on that close date."}, "doc.salesforce.opportunity_line_item_id": {"name": "opportunity_line_item_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_line_item_id", "block_contents": "The unique ID for each opportunity line item."}, "doc.salesforce.opportunity_line_item_name": {"name": "opportunity_line_item_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_line_item_name", "block_contents": "The unique name for each opportunity line item."}, "doc.salesforce.opportunity_line_item_description": {"name": "opportunity_line_item_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_line_item_description", "block_contents": "Text description of the opportunity line item."}, "doc.salesforce.opportunity_id": {"name": "opportunity_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_id", "block_contents": "ID of the associated Opportunity."}, "doc.salesforce.line_item_index": {"name": "line_item_index", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.line_item_index", "block_contents": "The index number of the specific line item, relative to all line items in that opportunity."}, "doc.salesforce.total_line_items": {"name": "total_line_items", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_line_items", "block_contents": "The total number of line items belonging to the same opportunity."}, "doc.salesforce.created_date": {"name": "created_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.created_date", "block_contents": "Created date."}, "doc.salesforce.last_modified_date": {"name": "last_modified_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.last_modified_date", "block_contents": "Last Modified Date."}, "doc.salesforce.service_date": {"name": "service_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.service_date", "block_contents": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored."}, "doc.salesforce.pricebook_entry_id": {"name": "pricebook_entry_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pricebook_entry_id", "block_contents": "ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field."}, "doc.salesforce.product_2_id": {"name": "product_2_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_2_id", "block_contents": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later.\nUse the PricebookEntryId field instead, specifying the ID of the PricebookEntry record."}, "doc.salesforce.product_2_name": {"name": "product_2_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_2_name", "block_contents": "Default name of the product."}, "doc.salesforce.product_code": {"name": "product_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_code", "block_contents": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record."}, "doc.salesforce.product_2_description": {"name": "product_2_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_2_description", "block_contents": "A text description of the product."}, "doc.salesforce.list_price": {"name": "list_price", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.list_price", "block_contents": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price."}, "doc.salesforce.quantity": {"name": "quantity", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.quantity", "block_contents": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule.\nWhen updating these records:\nIf you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant.\nIf you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust."}, "doc.salesforce.unit_price": {"name": "unit_price", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.unit_price", "block_contents": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price.\nThis field or TotalPrice is required. You can\u2019t specify both.\n\nIf you specify Discount and Quantity, this field or TotalPrice is required."}, "doc.salesforce.total_price": {"name": "total_price", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_price", "block_contents": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem.\nIf you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\n\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated."}, "doc.salesforce.has_quantity_schedule": {"name": "has_quantity_schedule", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.has_quantity_schedule", "block_contents": "Indicates whether a quantity schedule has been created for this object (true) or not (false)."}, "doc.salesforce.has_revenue_schedule": {"name": "has_revenue_schedule", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.has_revenue_schedule", "block_contents": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored."}, "doc.salesforce.product_external_id": {"name": "product_external_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_external_id", "block_contents": "The unique identifier of the product in the linked external data source. For example, ID #123."}, "doc.salesforce.product_family": {"name": "product_family", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_family", "block_contents": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family."}, "doc.salesforce.product_is_active": {"name": "product_is_active", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_is_active", "block_contents": "Indicates whether product is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active."}, "doc.salesforce.product_is_archived": {"name": "product_is_archived", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_is_archived", "block_contents": "Describes whether the product is archived. The default value is false."}, "doc.salesforce.product_is_deleted": {"name": "product_is_deleted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_is_deleted", "block_contents": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "doc.salesforce.product_number_of_quantity_installments": {"name": "product_number_of_quantity_installments", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_number_of_quantity_installments", "block_contents": "If the product has a quantity schedule, the number of installments."}, "doc.salesforce.product_quantity_installment_period": {"name": "product_quantity_installment_period", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_quantity_installment_period", "block_contents": "If the product has a quantity schedule, the amount of time covered by the schedule."}, "doc.salesforce.product_quantity_schedule_type": {"name": "product_quantity_schedule_type", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_quantity_schedule_type", "block_contents": "The type of the quantity schedule, if the product has one."}, "doc.salesforce.product_quantity_unit_of_measure": {"name": "product_quantity_unit_of_measure", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_quantity_unit_of_measure", "block_contents": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values."}, "doc.salesforce.product_number_of_revenue_installments": {"name": "product_number_of_revenue_installments", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_number_of_revenue_installments", "block_contents": "If the product has a revenue schedule, the number of installments."}, "doc.salesforce.product_revenue_installment_period": {"name": "product_revenue_installment_period", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_revenue_installment_period", "block_contents": "If the product has a revenue schedule, the time period covered by the schedule."}, "doc.salesforce.product_revenue_schedule_type": {"name": "product_revenue_schedule_type", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_revenue_schedule_type", "block_contents": "The type of the revenue schedule, if the product has one."}, "doc.salesforce.opportunities_created_amount": {"name": "opportunities_created_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_created_amount", "block_contents": "The dollar amount of all opportunities created for this day."}, "doc.salesforce.opportunities_won_amount": {"name": "opportunities_won_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_won_amount", "block_contents": "The dollar amount of all opportunities won for this day."}, "doc.salesforce.opportunities_lost_amount": {"name": "opportunities_lost_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_lost_amount", "block_contents": "The dollar amount of all opportunities lost for this day."}, "doc.salesforce.pipeline_amount": {"name": "pipeline_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_amount", "block_contents": "The dollar amount of all opportunities in the pipeline for this day."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.salesforce_integration_tests.consistency_daily_activity_count": [{"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "consistency_daily_activity_count", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_daily_activity_count.sql", "original_file_path": "tests/consistency/consistency_daily_activity_count.sql", "unique_id": "test.salesforce_integration_tests.consistency_daily_activity_count", "fqn": ["salesforce_integration_tests", "consistency", "consistency_daily_activity_count"], "alias": "consistency_daily_activity_count", "checksum": {"name": "sha256", "checksum": "b8e0325309076328ccbce499ce320154cf7f901f007dcefdf448d0f88315ed6c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1720572443.9942899, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test is to make sure the rows counts are the same between versions\nwith prod as (\n select count(*) as prod_rows\n from {{ target.schema }}_salesforce_prod.salesforce__daily_activity\n),\n\ndev as (\n select count(*) as dev_rows\n from {{ target.schema }}_salesforce_dev.salesforce__daily_activity\n)\n\n-- test will return values and fail if the row counts don't match\nselect *\nfrom prod\njoin dev\n on prod.prod_rows != dev.dev_rows", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_columns": [{"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "consistency_columns", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_columns.sql", "original_file_path": "tests/consistency/consistency_columns.sql", "unique_id": "test.salesforce_integration_tests.consistency_columns", "fqn": ["salesforce_integration_tests", "consistency", "consistency_columns"], "alias": "consistency_columns", "checksum": {"name": "sha256", "checksum": "1928b992e3c438eddcc4ea8d175836990f0c25cd7cf0bca8bd8879e5e8b7edbb"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1720572444.031393, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n/* This test is to make sure the final columns produced are the same between versions.\nOnly one test is needed since it will fetch all tables and all columns in each schema.\n!!! THIS TEST IS WRITTEN FOR BIGQUERY!!! */\n{% if target.type == 'bigquery' %}\nwith prod as (\n select\n table_name,\n column_name,\n /* Need the case since the prod version is uncasted, and bigquery automatically produces a value of \"bignumeric\" or \"float\"\n while the dev is casted as dbt.type_numeric() and produces a value of \"numeric\" */\n case when lower(data_type) like '%numeric%' or lower(data_type) like '%float%' then 'numeric'\n else data_type \n end as data_type\n from {{ target.schema }}_salesforce_prod.INFORMATION_SCHEMA.COLUMNS\n),\n\ndev as (\n select\n table_name,\n column_name,\n case when lower(data_type) like '%numeric%' or lower(data_type) like '%float%' then 'numeric'\n else data_type \n end as data_type\n from {{ target.schema }}_salesforce_dev.INFORMATION_SCHEMA.COLUMNS\n),\n\nfinal as (\n -- test will fail if any rows from prod are not found in dev\n (select * from prod\n except distinct\n select * from dev)\n\n union all -- union since we only care if rows are produced\n\n -- test will fail if any rows from dev are not found in prod\n (select * from dev\n except distinct\n select * from prod)\n)\n\nselect *\nfrom final\n\n{% else %}\n{{ print('This is written to run on bigquery. If you need to run on another warehouse, add another version for that warehouse') }}\n\n{% endif %}", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_daily_activity": [{"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "consistency_daily_activity", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_daily_activity.sql", "original_file_path": "tests/consistency/consistency_daily_activity.sql", "unique_id": "test.salesforce_integration_tests.consistency_daily_activity", "fqn": ["salesforce_integration_tests", "consistency", "consistency_daily_activity"], "alias": "consistency_daily_activity", "checksum": {"name": "sha256", "checksum": "ffb5db2a58695bebe03726d09784e92fe3e913c25492f6b3799578b80d42f4a1"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1720572444.034764, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test ensures the daily_activity end model matches the prior version\nwith prod as (\n select *\n from {{ target.schema }}_salesforce_prod.salesforce__daily_activity\n),\n\ndev as (\n select *\n from {{ target.schema }}_salesforce_dev.salesforce__daily_activity\n),\n\nfinal as (\n -- test will fail if any rows from prod are not found in dev\n (select * from prod\n except distinct\n select * from dev)\n\n union all -- union since we only care if rows are produced\n\n -- test will fail if any rows from dev are not found in prod\n (select * from dev\n except distinct\n select * from prod)\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.integrity_daily_activity": [{"database": "postgres", "schema": "zz_dbt_catherine_sf_dbt_test__audit", "name": "integrity_daily_activity", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "integrity/integrity_daily_activity.sql", "original_file_path": "tests/integrity/integrity_daily_activity.sql", "unique_id": "test.salesforce_integration_tests.integrity_daily_activity", "fqn": ["salesforce_integration_tests", "integrity", "integrity_daily_activity"], "alias": "integrity_daily_activity", "checksum": {"name": "sha256", "checksum": "789a0f94dc8007ba5b1c60c235b74efc7ab210eeeb7e5b9c42d42a6da6ee682f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1720572444.0376189, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test is to make sure there is no fanout between the spine and the daily_activity\nwith spine as (\n select count(*) as spine_count\n from {{ target.schema }}_salesforce_dev.int_salesforce__date_spine\n),\n\ndaily_activity as (\n select count(*) as daily_activity_count\n from {{ target.schema }}_salesforce_dev.salesforce__daily_activity\n)\n\n-- test will return values and fail if the row counts don't match\nselect *\nfrom spine\njoin daily_activity\n on spine.spine_count != daily_activity.daily_activity_count", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}]}, "parent_map": {"seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_opportunity_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "model.salesforce.salesforce__contact_daily_history": ["model.salesforce_source.stg_salesforce__contact_history"], "model.salesforce.salesforce__opportunity_daily_history": ["model.salesforce_source.stg_salesforce__opportunity_history"], "model.salesforce.salesforce__account_daily_history": ["model.salesforce_source.stg_salesforce__account_history"], "model.salesforce.salesforce__opportunity_enhanced": ["model.salesforce_source.stg_salesforce__account", "model.salesforce_source.stg_salesforce__opportunity", "model.salesforce_source.stg_salesforce__user", "model.salesforce_source.stg_salesforce__user_role"], "model.salesforce.salesforce__owner_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user"], "model.salesforce.salesforce__opportunity_line_item_enhanced": ["model.salesforce_source.stg_salesforce__opportunity_line_item", "model.salesforce_source.stg_salesforce__product_2"], "model.salesforce.salesforce__sales_snapshot": ["model.salesforce.salesforce__opportunity_enhanced"], "model.salesforce.salesforce__contact_enhanced": ["model.salesforce_source.stg_salesforce__account", "model.salesforce_source.stg_salesforce__contact", "model.salesforce_source.stg_salesforce__user"], "model.salesforce.salesforce__daily_activity": ["model.salesforce.int_salesforce__date_spine", "model.salesforce_source.stg_salesforce__event", "model.salesforce_source.stg_salesforce__lead", "model.salesforce_source.stg_salesforce__opportunity", "model.salesforce_source.stg_salesforce__task"], "model.salesforce.salesforce__manager_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user", "model.salesforce_source.stg_salesforce__user_role"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce_source.stg_salesforce__user"], "model.salesforce.int_salesforce__date_spine": [], "model.salesforce_source.stg_salesforce__opportunity_history": ["source.salesforce_source.salesforce_history.opportunity"], "model.salesforce_source.stg_salesforce__account_history": ["source.salesforce_source.salesforce_history.account"], "model.salesforce_source.stg_salesforce__contact_history": ["source.salesforce_source.salesforce_history.contact"], "model.salesforce_source.stg_salesforce__opportunity": ["source.salesforce_source.salesforce.opportunity"], "model.salesforce_source.stg_salesforce__user_role": ["source.salesforce_source.salesforce.user_role"], "model.salesforce_source.stg_salesforce__contact": ["source.salesforce_source.salesforce.contact"], "model.salesforce_source.stg_salesforce__account": ["source.salesforce_source.salesforce.account"], "model.salesforce_source.stg_salesforce__lead": ["source.salesforce_source.salesforce.lead"], "model.salesforce_source.stg_salesforce__order": ["source.salesforce_source.salesforce.order"], "model.salesforce_source.stg_salesforce__event": ["source.salesforce_source.salesforce.event"], "model.salesforce_source.stg_salesforce__product_2": ["source.salesforce_source.salesforce.product_2"], "model.salesforce_source.stg_salesforce__opportunity_line_item": ["source.salesforce_source.salesforce.opportunity_line_item"], "model.salesforce_source.stg_salesforce__user": ["source.salesforce_source.salesforce.user"], "model.salesforce_source.stg_salesforce__task": ["source.salesforce_source.salesforce.task"], "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": ["model.salesforce.salesforce__account_daily_history"], "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb": ["model.salesforce.salesforce__account_daily_history"], "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c": ["model.salesforce.salesforce__contact_daily_history"], "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52": ["model.salesforce.salesforce__contact_daily_history"], "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849": ["model.salesforce.salesforce__opportunity_daily_history"], "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660": ["model.salesforce.salesforce__opportunity_daily_history"], "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": ["model.salesforce.salesforce__manager_performance"], "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781": ["model.salesforce.salesforce__manager_performance"], "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7": ["model.salesforce.salesforce__owner_performance"], "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7": ["model.salesforce.salesforce__owner_performance"], "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc": ["model.salesforce.salesforce__opportunity_enhanced"], "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788": ["model.salesforce.salesforce__opportunity_enhanced"], "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e": ["model.salesforce.salesforce__contact_enhanced"], "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93": ["model.salesforce.salesforce__contact_enhanced"], "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04": ["model.salesforce.salesforce__daily_activity"], "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8": ["model.salesforce.salesforce__daily_activity"], "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32": ["model.salesforce.salesforce__opportunity_line_item_enhanced"], "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa": ["model.salesforce.salesforce__opportunity_line_item_enhanced"], "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": ["model.salesforce_source.stg_salesforce__account_history"], "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f": ["model.salesforce_source.stg_salesforce__account_history"], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6": ["model.salesforce_source.stg_salesforce__account_history"], "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": ["model.salesforce_source.stg_salesforce__contact_history"], "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": ["model.salesforce_source.stg_salesforce__contact_history"], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee": ["model.salesforce_source.stg_salesforce__contact_history"], "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": ["model.salesforce_source.stg_salesforce__opportunity_history"], "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": ["model.salesforce_source.stg_salesforce__opportunity_history"], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435": ["model.salesforce_source.stg_salesforce__opportunity_history"], "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4": ["model.salesforce_source.stg_salesforce__account"], "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7": ["model.salesforce_source.stg_salesforce__account"], "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": ["model.salesforce_source.stg_salesforce__opportunity"], "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": ["model.salesforce_source.stg_salesforce__opportunity"], "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65": ["model.salesforce_source.stg_salesforce__user"], "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152": ["model.salesforce_source.stg_salesforce__user"], "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": ["model.salesforce_source.stg_salesforce__user_role"], "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718": ["model.salesforce_source.stg_salesforce__user_role"], "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78": ["model.salesforce_source.stg_salesforce__contact"], "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e": ["model.salesforce_source.stg_salesforce__contact"], "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8": ["model.salesforce_source.stg_salesforce__event"], "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9": ["model.salesforce_source.stg_salesforce__event"], "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": ["model.salesforce_source.stg_salesforce__lead"], "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282": ["model.salesforce_source.stg_salesforce__lead"], "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": ["model.salesforce_source.stg_salesforce__opportunity_line_item"], "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": ["model.salesforce_source.stg_salesforce__opportunity_line_item"], "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f": ["model.salesforce_source.stg_salesforce__order"], "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c": ["model.salesforce_source.stg_salesforce__order"], "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": ["model.salesforce_source.stg_salesforce__product_2"], "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": ["model.salesforce_source.stg_salesforce__product_2"], "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9": ["model.salesforce_source.stg_salesforce__task"], "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605": ["model.salesforce_source.stg_salesforce__task"], "source.salesforce_source.salesforce_history.account": [], "source.salesforce_source.salesforce_history.contact": [], "source.salesforce_source.salesforce_history.opportunity": [], "source.salesforce_source.salesforce.account": [], "source.salesforce_source.salesforce.opportunity": [], "source.salesforce_source.salesforce.user": [], "source.salesforce_source.salesforce.user_role": [], "source.salesforce_source.salesforce.contact": [], "source.salesforce_source.salesforce.event": [], "source.salesforce_source.salesforce.lead": [], "source.salesforce_source.salesforce.opportunity_line_item": [], "source.salesforce_source.salesforce.order": [], "source.salesforce_source.salesforce.product_2": [], "source.salesforce_source.salesforce.task": [], "source.salesforce_source.salesforce.fivetran_formula": [], "source.salesforce_source.salesforce.fivetran_formula_model": []}, "child_map": {"seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_opportunity_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "model.salesforce.salesforce__contact_daily_history": ["test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52", "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c"], "model.salesforce.salesforce__opportunity_daily_history": ["test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660", "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849"], "model.salesforce.salesforce__account_daily_history": ["test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb", "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581"], "model.salesforce.salesforce__opportunity_enhanced": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.salesforce__sales_snapshot", "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc", "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788"], "model.salesforce.salesforce__owner_performance": ["test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7", "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7"], "model.salesforce.salesforce__opportunity_line_item_enhanced": ["test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa", "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32"], "model.salesforce.salesforce__sales_snapshot": [], "model.salesforce.salesforce__contact_enhanced": ["test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e"], "model.salesforce.salesforce__daily_activity": ["test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04"], "model.salesforce.salesforce__manager_performance": ["test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__owner_performance"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce.salesforce__daily_activity"], "model.salesforce_source.stg_salesforce__opportunity_history": ["model.salesforce.salesforce__opportunity_daily_history", "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435", "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67"], "model.salesforce_source.stg_salesforce__account_history": ["model.salesforce.salesforce__account_daily_history", "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6", "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f"], "model.salesforce_source.stg_salesforce__contact_history": ["model.salesforce.salesforce__contact_daily_history", "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee", "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d"], "model.salesforce_source.stg_salesforce__opportunity": ["model.salesforce.salesforce__daily_activity", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a"], "model.salesforce_source.stg_salesforce__user_role": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718"], "model.salesforce_source.stg_salesforce__contact": ["model.salesforce.salesforce__contact_enhanced", "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e"], "model.salesforce_source.stg_salesforce__account": ["model.salesforce.salesforce__contact_enhanced", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4", "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7"], "model.salesforce_source.stg_salesforce__lead": ["model.salesforce.salesforce__daily_activity", "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282"], "model.salesforce_source.stg_salesforce__order": ["test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f", "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c"], "model.salesforce_source.stg_salesforce__event": ["model.salesforce.salesforce__daily_activity", "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8", "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9"], "model.salesforce_source.stg_salesforce__product_2": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61"], "model.salesforce_source.stg_salesforce__opportunity_line_item": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902"], "model.salesforce_source.stg_salesforce__user": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.salesforce__contact_enhanced", "model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__opportunity_enhanced", "model.salesforce.salesforce__owner_performance", "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65", "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152"], "model.salesforce_source.stg_salesforce__task": ["model.salesforce.salesforce__daily_activity", "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9", "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605"], "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": [], "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb": [], "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c": [], "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52": [], "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849": [], "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660": [], "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": [], "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781": [], "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7": [], "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7": [], "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc": [], "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788": [], "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e": [], "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93": [], "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04": [], "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8": [], "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32": [], "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa": [], "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": [], "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f": [], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6": [], "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": [], "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": [], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee": [], "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": [], "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": [], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435": [], "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4": [], "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7": [], "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": [], "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": [], "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65": [], "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152": [], "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": [], "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718": [], "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78": [], "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e": [], "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8": [], "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9": [], "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": [], "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282": [], "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": [], "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": [], "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f": [], "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c": [], "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": [], "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": [], "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9": [], "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605": [], "source.salesforce_source.salesforce_history.account": ["model.salesforce_source.stg_salesforce__account_history"], "source.salesforce_source.salesforce_history.contact": ["model.salesforce_source.stg_salesforce__contact_history"], "source.salesforce_source.salesforce_history.opportunity": ["model.salesforce_source.stg_salesforce__opportunity_history"], "source.salesforce_source.salesforce.account": ["model.salesforce_source.stg_salesforce__account"], "source.salesforce_source.salesforce.opportunity": ["model.salesforce_source.stg_salesforce__opportunity"], "source.salesforce_source.salesforce.user": ["model.salesforce_source.stg_salesforce__user"], "source.salesforce_source.salesforce.user_role": ["model.salesforce_source.stg_salesforce__user_role"], "source.salesforce_source.salesforce.contact": ["model.salesforce_source.stg_salesforce__contact"], "source.salesforce_source.salesforce.event": ["model.salesforce_source.stg_salesforce__event"], "source.salesforce_source.salesforce.lead": ["model.salesforce_source.stg_salesforce__lead"], "source.salesforce_source.salesforce.opportunity_line_item": ["model.salesforce_source.stg_salesforce__opportunity_line_item"], "source.salesforce_source.salesforce.order": ["model.salesforce_source.stg_salesforce__order"], "source.salesforce_source.salesforce.product_2": ["model.salesforce_source.stg_salesforce__product_2"], "source.salesforce_source.salesforce.task": ["model.salesforce_source.stg_salesforce__task"], "source.salesforce_source.salesforce.fivetran_formula": [], "source.salesforce_source.salesforce.fivetran_formula_model": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.8.3", "generated_at": "2024-07-23T21:34:48.056358Z", "invocation_id": "8953cfeb-e6f4-47c1-be99-b3c6436f0b90", "env": {}, "project_name": "salesforce_integration_tests", "project_id": "587a8ff6488a773aca368d80d6016991", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.salesforce_integration_tests.sf_lead_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_lead_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_lead_data.csv", "original_file_path": "seeds/sf_lead_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_lead_data", "fqn": ["salesforce_integration_tests", "sf_lead_data"], "alias": "sf_lead_data", "checksum": {"name": "sha256", "checksum": "04c65ab4f75626fc9f14eefd9d65ef15e0523670d782359ab586e73728a4cc60"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "converted_date": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"converted_date": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.538808, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_lead_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_product_2_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_product_2_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_product_2_data.csv", "original_file_path": "seeds/sf_product_2_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_product_2_data", "fqn": ["salesforce_integration_tests", "sf_product_2_data"], "alias": "sf_product_2_data", "checksum": {"name": "sha256", "checksum": "a227b4c050e2eef218b1757e2cf7b282dcc022fb2a4e1d761fc48481e74c7230"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.543238, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_product_2_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_role_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_user_role_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_user_role_data.csv", "original_file_path": "seeds/sf_user_role_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_user_role_data", "fqn": ["salesforce_integration_tests", "sf_user_role_data"], "alias": "sf_user_role_data", "checksum": {"name": "sha256", "checksum": "2f3861fe3fccbbfb3056beab2f7b6b159910bcf898cade04789a6be752bbf996"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean"}}, "created_at": 1721770461.544619, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_user_role_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_account_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_account_data.csv", "original_file_path": "seeds/sf_account_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_account_data", "fqn": ["salesforce_integration_tests", "sf_account_data"], "alias": "sf_account_data", "checksum": {"name": "sha256", "checksum": "50ebb7785eeb7b560b9c2199d9d0d3686080124b3a37bf571051ea54c6a3c5b4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "annual_revenue": "float", "billing_latitude": "float", "billing_longitude": "float", "shipping_latitude": "float", "shipping_longitude": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "annual_revenue": "float", "billing_latitude": "float", "billing_longitude": "float", "shipping_latitude": "float", "shipping_longitude": "float"}}, "created_at": 1721770461.5461278, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_account_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_line_item_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_opportunity_line_item_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_opportunity_line_item_data.csv", "original_file_path": "seeds/sf_opportunity_line_item_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_opportunity_line_item_data", "fqn": ["salesforce_integration_tests", "sf_opportunity_line_item_data"], "alias": "sf_opportunity_line_item_data", "checksum": {"name": "sha256", "checksum": "da3d703e060791ee354dfe83830d026531816141846eda4837b517c5a34b0abd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "service_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"created_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "service_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.547659, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_opportunity_line_item_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_user_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_user_data.csv", "original_file_path": "seeds/sf_user_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_user_data", "fqn": ["salesforce_integration_tests", "sf_user_data"], "alias": "sf_user_data", "checksum": {"name": "sha256", "checksum": "6ca1169abd0988ebf457e230d077fb22c32404626864575d9b87bd9745cc7a55"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "last_login_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "offline_trial_expiration_date": "timestamp", "latitude": "float", "longitude": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"last_login_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "offline_trial_expiration_date": "timestamp", "latitude": "float", "longitude": "float"}}, "created_at": 1721770461.549291, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_user_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_contact_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_contact_data.csv", "original_file_path": "seeds/sf_contact_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_contact_data", "fqn": ["salesforce_integration_tests", "sf_contact_data"], "alias": "sf_contact_data", "checksum": {"name": "sha256", "checksum": "e4b8953b2e16533efb7c0bb9f246f64d5b9fad22ed16fb2d65629a02524b78d0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "birthdate": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_curequest_date": "timestamp", "last_cuupdate_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"birthdate": "timestamp", "created_date": "timestamp", "email_bounced_date": "timestamp", "last_activity_date": "timestamp", "last_curequest_date": "timestamp", "last_cuupdate_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.550812, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_contact_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_opportunity_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_opportunity_data.csv", "original_file_path": "seeds/sf_opportunity_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_opportunity_data", "fqn": ["salesforce_integration_tests", "sf_opportunity_data"], "alias": "sf_opportunity_data", "checksum": {"name": "sha256", "checksum": "6a109616a284522a02550d21119c0257d788a33d01b2ded463808a467266873a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "probability": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "probability": "float"}}, "created_at": 1721770461.5525591, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_opportunity_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_history_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_opportunity_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_opportunity_history_data.csv", "original_file_path": "seeds/sf_opportunity_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_opportunity_history_data", "fqn": ["salesforce_integration_tests", "sf_opportunity_history_data"], "alias": "sf_opportunity_history_data", "checksum": {"name": "sha256", "checksum": "a28441bbd95128aa6440a32b8faec0a21cec1f6e3eae8ff804ba2bdcb499381f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "expected_revenue": "float", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"close_date": "timestamp", "created_date": "timestamp", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "amount": "float", "expected_revenue": "float", "is_deleted": "boolean"}}, "created_at": 1721770461.554102, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_opportunity_history_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_order_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_order_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_order_data.csv", "original_file_path": "seeds/sf_order_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_order_data", "fqn": ["salesforce_integration_tests", "sf_order_data"], "alias": "sf_order_data", "checksum": {"name": "sha256", "checksum": "4cf8cc6e6eb58e8e502f3204fd430468b1c63e35766c56f2fd3029a6988f06f4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activated_date": "timestamp", "created_date": "timestamp", "effective_date": "timestamp", "end_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"activated_date": "timestamp", "created_date": "timestamp", "effective_date": "timestamp", "end_date": "timestamp", "last_modified_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.5555542, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_order_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_event_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_event_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_event_data.csv", "original_file_path": "seeds/sf_event_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_event_data", "fqn": ["salesforce_integration_tests", "sf_event_data"], "alias": "sf_event_data", "checksum": {"name": "sha256", "checksum": "7dc5596105508d36674a5019e42592dd7cc48391842da432c7d02f46b63f820a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activity_date": "timestamp", "activity_date_time": "timestamp", "created_date": "timestamp", "end_date": "timestamp", "end_date_time": "timestamp", "last_modified_date": "timestamp", "recurrence_2_pattern_start_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_time": "timestamp", "reminder_date_time": "timestamp", "start_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"activity_date": "timestamp", "activity_date_time": "timestamp", "created_date": "timestamp", "end_date": "timestamp", "end_date_time": "timestamp", "last_modified_date": "timestamp", "recurrence_2_pattern_start_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_time": "timestamp", "reminder_date_time": "timestamp", "start_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.5570319, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_event_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_history_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_contact_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_contact_history_data.csv", "original_file_path": "seeds/sf_contact_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_contact_history_data", "fqn": ["salesforce_integration_tests", "sf_contact_history_data"], "alias": "sf_contact_history_data", "checksum": {"name": "sha256", "checksum": "2a872395946af58b6d08eb9be088c1ca2f2e9ffe0b224c3bbcd92086ad2e6507"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "birthdate": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"birthdate": "timestamp", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.558858, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_contact_history_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_history_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_account_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_account_history_data.csv", "original_file_path": "seeds/sf_account_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_account_history_data", "fqn": ["salesforce_integration_tests", "sf_account_history_data"], "alias": "sf_account_history_data", "checksum": {"name": "sha256", "checksum": "e19660a78e56a685df80329bfbcf71324f09a2d5a421540f5fa34cd23d740dcb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "annual_revenue": "float", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"annual_revenue": "float", "last_activity_date": "timestamp", "last_referenced_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.56046, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_account_history_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_task_data": {"database": "postgres", "schema": "zz_salesforce", "name": "sf_task_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_task_data.csv", "original_file_path": "seeds/sf_task_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_task_data", "fqn": ["salesforce_integration_tests", "sf_task_data"], "alias": "sf_task_data", "checksum": {"name": "sha256", "checksum": "b885e6f9737a8e1695c90c0dbbcfbbf3d4849bf3bbc7aba808b44c6d8eac772c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activity_date": "timestamp", "completed_date_time": "timestamp", "created_date": "timestamp", "last_modified_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_only": "timestamp", "reminder_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"activity_date": "timestamp", "completed_date_time": "timestamp", "created_date": "timestamp", "last_modified_date": "timestamp", "recurrence_end_date_only": "timestamp", "recurrence_start_date_only": "timestamp", "reminder_date_time": "timestamp", "system_modstamp": "timestamp", "is_deleted": "boolean"}}, "created_at": 1721770461.5619211, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_task_data\"", "raw_code": "", "root_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "model.salesforce.salesforce__contact_daily_history": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__contact_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__contact_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__contact_daily_history.sql", "unique_id": "model.salesforce.salesforce__contact_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__contact_daily_history"], "alias": "salesforce__contact_daily_history", "checksum": {"name": "sha256", "checksum": "d42a70ca24d744be0f8bedf78e2e5e6e013fa2f019af3d5846527e6a56d40601"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "contact_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Each record is a daily record in a contact, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"contact_day_id": {"name": "contact_day_id", "description": "Surrogate key hashed on `date_day` and `contact_id`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "contact_day_id", "incremental_strategy": "delete+insert", "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.266526, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__contact_history_enabled', False),\n materialized = 'incremental',\n partition_by = {\n 'field': 'date_day', \n 'data_type': 'date'\n } if target.type not in ['spark', 'databricks'] else ['date_day'],\n unique_key = 'contact_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'parquet',\n on_schema_change = 'fail'\n )\n}}\n\n{% if execute %}\n {% set date_query %}\n select \n {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date\n {% endset %}\n\n {% set last_date = run_query(date_query).columns[0][0]|string %}\n\n {# If only compiling, creates range going back 1 year #}\n {% else %} \n {% set last_date = dbt.dateadd(\"year\", \"-1\", \"current_date\") %}\n {% endif %}\n\n\nwith spine as (\n {# Prioritizes variables over calculated dates #}\n {% set first_date = var('contact_history_start_date', var('global_history_start_date', '2020-01-01'))|string %}\n {% set last_date = last_date|string %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\",\n end_date = \"cast('\" ~ last_date[0:10] ~ \"'as date)\"\n )\n }}\n),\n\ncontact_history as (\n\n select * \n from {{ var('contact_history') }}\n {% if is_incremental() %}\n where _fivetran_start >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% endif %} \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, contact_id\n order by _fivetran_start desc) as row_num \n from contact_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.contact_id']) }} as contact_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }})\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }})\n)\n\nselect * \nfrom daily_history", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.run_query"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__contact_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1665\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-23'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncontact_history as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, contact_id\n order by _fivetran_start desc) as row_num \n from contact_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.contact_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as contact_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_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}, "model.salesforce.salesforce__opportunity_daily_history": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__opportunity_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__opportunity_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__opportunity_daily_history.sql", "unique_id": "model.salesforce.salesforce__opportunity_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__opportunity_daily_history"], "alias": "salesforce__opportunity_daily_history", "checksum": {"name": "sha256", "checksum": "30a4d6d24c726b6bba850f4fc28c2ce92a19a2e45aa887833021ebf8b672c548"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "opportunity_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Each record is a daily record in an opportunity, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"opportunity_day_id": {"name": "opportunity_day_id", "description": "Surrogate key hashed on `date_day` and `opportunity_id`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "opportunity_day_id", "incremental_strategy": "delete+insert", "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.271165, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__opportunity_history_enabled', False),\n materialized = 'incremental',\n partition_by = {\n 'field': 'date_day', \n 'data_type': 'date'\n } if target.type not in ['spark', 'databricks'] else ['date_day'],\n unique_key = 'opportunity_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'parquet',\n on_schema_change = 'fail'\n )\n}}\n\n\n{% if execute %}\n {% set date_query %}\n select \n {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date\n {% endset %}\n\n {% set last_date = run_query(date_query).columns[0][0]|string %}\n\n {# If only compiling, creates range going back 1 year #}\n {% else %} \n {% set last_date = dbt.dateadd(\"year\", \"-1\", \"current_date\") %}\n {% endif %}\n\n\nwith spine as (\n {# Prioritizes variables over calculated dates #}\n {% set first_date = var('opportunity_history_start_date', var('global_history_start_date', '2020-01-01'))|string %}\n {% set last_date = last_date|string %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\",\n end_date = \"cast('\" ~ last_date[0:10] ~ \"'as date)\"\n )\n }}\n),\n\nopportunity_history as (\n\n select * \n from {{ var('opportunity_history') }}\n {% if is_incremental() %}\n where _fivetran_start >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% endif %} \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, opportunity_id\n order by _fivetran_start desc) as row_num \n from opportunity_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.opportunity_id']) }} as opportunity_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }})\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }})\n)\n\nselect * \nfrom daily_history", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.run_query"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__opportunity_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1665\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-23'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\nopportunity_history as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, opportunity_id\n order by _fivetran_start desc) as row_num \n from opportunity_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.opportunity_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as opportunity_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_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}, "model.salesforce.salesforce__account_daily_history": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__account_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__account_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__account_daily_history.sql", "unique_id": "model.salesforce.salesforce__account_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__account_daily_history"], "alias": "salesforce__account_daily_history", "checksum": {"name": "sha256", "checksum": "ab3781e38a81a1da1c83c76ea2a8fa284be86c6cd05cd0f77281d0d3444d4a97"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "account_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Each record is a daily record in an account, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"account_day_id": {"name": "account_day_id", "description": "Surrogate key hashed on `date_day` and `account_id`", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Date on which the account had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "account_day_id", "incremental_strategy": "delete+insert", "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.261787, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__account_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__account_history_enabled', False),\n materialized = 'incremental',\n partition_by = {\n 'field': 'date_day', \n 'data_type': 'date'\n } if target.type not in ['spark', 'databricks'] else ['date_day'],\n unique_key = 'account_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'parquet',\n on_schema_change = 'fail'\n )\n}}\n\n{% if execute %}\n {% set date_query %}\n select \n {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date\n {% endset %}\n\n {% set last_date = run_query(date_query).columns[0][0]|string %}\n\n {# If only compiling, creates range going back 1 year #}\n {% else %} \n {% set last_date = dbt.dateadd(\"year\", \"-1\", \"current_date\") %}\n {% endif %}\n\n\nwith spine as (\n {# Prioritizes variables over calculated dates #}\n {% set first_date = var('account_history_start_date', var('global_history_start_date', '2020-01-01'))|string %}\n {% set last_date = last_date|string %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date[0:10] ~ \"'as date)\",\n end_date = \"cast('\" ~ last_date[0:10] ~ \"'as date)\"\n )\n }}\n),\n\naccount_history as (\n\n select * \n from {{ var('account_history') }}\n {% if is_incremental() %}\n where _fivetran_start >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% endif %} \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, account_id\n order by _fivetran_start desc) as row_num \n from account_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.account_id']) }} as account_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }})\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }})\n)\n\nselect * \nfrom daily_history", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.run_query"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__account_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1665\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-23'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\naccount_history as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, account_id\n order by _fivetran_start desc) as row_num \n from account_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.account_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as account_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_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}, "model.salesforce.salesforce__opportunity_enhanced": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__opportunity_enhanced", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__opportunity_enhanced.sql", "original_file_path": "models/salesforce/salesforce__opportunity_enhanced.sql", "unique_id": "model.salesforce.salesforce__opportunity_enhanced", "fqn": ["salesforce", "salesforce", "salesforce__opportunity_enhanced"], "alias": "salesforce__opportunity_enhanced", "checksum": {"name": "sha256", "checksum": "7913bd625bdc80f24f5cc863c610512e0f62c44b2b8a4efeaaee36bf5e0cb371"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "This table both cleans and enhances your opportunities source table with information about the associate account and opportunity owner.\n", "columns": {"opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Number of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_amount_this_month": {"name": "closed_amount_this_month", "description": "The opportunity amount, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_amount_this_quarter": {"name": "closed_amount_this_quarter", "description": "The opportunity amount, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_count_this_month": {"name": "closed_count_this_month", "description": "The opportunity count, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "closed_count_this_quarter": {"name": "closed_count_this_quarter", "description": "The opportunity count, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_amount_this_month": {"name": "created_amount_this_month", "description": "The opportunity amount, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_amount_this_quarter": {"name": "created_amount_this_quarter", "description": "The opportunity amount, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_count_this_month": {"name": "created_count_this_month", "description": "The opportunity count, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_count_this_quarter": {"name": "created_count_this_quarter", "description": "The opportunity count, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_since_created": {"name": "days_since_created", "description": "The difference in days between the current day and the day the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_close": {"name": "days_to_close", "description": "The difference in days between the close day and the day the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "The category of the state of the opportunity. Default values are 'pipeline','forecast','bestcase','closed', and 'omited'", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_month": {"name": "is_closed_this_month", "description": "Boolean field, indicating whether the closed month is equal to the current month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_quarter": {"name": "is_closed_this_quarter", "description": "Boolean field, indicating whether the closed quarter is equal to the current quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_month": {"name": "is_created_this_month", "description": "Boolean field, indicating whether the created date is greater than or equal to the first day of this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_quarter": {"name": "is_created_this_quarter", "description": "Boolean field, indicating whether the created date is greater than or equal to the first day of this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_account_id": {"name": "opportunity_account_id", "description": "The id of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_city": {"name": "opportunity_manager_city", "description": "The city associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_id": {"name": "opportunity_manager_id", "description": "The Id of the user who manages this owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_name": {"name": "opportunity_manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_manager_state": {"name": "opportunity_manager_state", "description": "The state associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_city": {"name": "opportunity_owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_id": {"name": "opportunity_owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_name": {"name": "opportunity_owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_state": {"name": "opportunity_owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_role_id": {"name": "opportunity_owner_role_id", "description": "The ID associated with the owner's user role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Id of the owner of this opportunity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Whether the opportunity is won, lost, in the pipeline, or other.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_position": {"name": "opportunity_owner_position", "description": "Name of the position of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_developer_name": {"name": "opportunity_owner_developer_name", "description": "The name of the object of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_parent_role_id": {"name": "opportunity_owner_parent_role_id", "description": "The ID of the parent role of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_owner_rollup_description": {"name": "opportunity_owner_rollup_description", "description": "Description of the forecast rollup of the opportunity owner..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.335138, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"", "raw_code": "with opportunity as (\n\n select *\n from {{ var('opportunity') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n{% if var('salesforce__user_role_enabled', True) %}\nuser_role as (\n\n select *\n from {{ var('user_role') }}\n), \n{% endif %}\n\naccount as (\n\n select *\n from {{ var('account') }}\n), \n\nadd_fields as (\n\n select \n opportunity.*,\n account.account_number,\n account.account_source,\n account.industry,\n account.account_name,\n account.number_of_employees,\n account.type as account_type,\n opportunity_owner.user_id as opportunity_owner_id,\n opportunity_owner.user_name as opportunity_owner_name,\n opportunity_owner.user_role_id as opportunity_owner_role_id,\n opportunity_owner.city opportunity_owner_city,\n opportunity_owner.state as opportunity_owner_state,\n opportunity_manager.user_id as opportunity_manager_id,\n opportunity_manager.user_name as opportunity_manager_name,\n opportunity_manager.city opportunity_manager_city,\n opportunity_manager.state as opportunity_manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n user_role.user_role_name as opportunity_owner_position, \n user_role.developer_name as opportunity_owner_developer_name,\n user_role.parent_role_id as opportunity_owner_parent_role_id,\n user_role.rollup_description as opportunity_owner_rollup_description,\n {% endif %}\n\n case\n when opportunity.is_won then 'Won'\n when not opportunity.is_won and opportunity.is_closed then 'Lost'\n when not opportunity.is_closed and lower(opportunity.forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status,\n case when is_created_this_month then amount else 0 end as created_amount_this_month,\n case when is_created_this_quarter then amount else 0 end as created_amount_this_quarter,\n case when is_created_this_month then 1 else 0 end as created_count_this_month,\n case when is_created_this_quarter then 1 else 0 end as created_count_this_quarter,\n case when is_closed_this_month then amount else 0 end as closed_amount_this_month,\n case when is_closed_this_quarter then amount else 0 end as closed_amount_this_quarter,\n case when is_closed_this_month then 1 else 0 end as closed_count_this_month,\n case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__account_pass_through_columns', identifier='account') }}\n {{ custom_persist_pass_through_columns(pass_through_variable='salesforce__user_pass_through_columns', identifier='opportunity_owner', append_string= '_owner') }}\n {{ custom_persist_pass_through_columns(pass_through_variable='salesforce__user_pass_through_columns', identifier='opportunity_manager', append_string= '_manager') }}\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__user_role_pass_through_columns', identifier='user_role') }}\n {% endif %}\n\n from opportunity\n left join account \n on opportunity.account_id = account.account_id\n left join salesforce_user as opportunity_owner \n on opportunity.owner_id = opportunity_owner.user_id\n left join salesforce_user as opportunity_manager \n on opportunity_owner.manager_id = opportunity_manager.user_id\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n left join user_role \n on opportunity_owner.user_role_id = user_role.user_role_id\n {% endif %}\n)\n\nselect *\nfrom add_fields", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}, {"name": "stg_salesforce__user_role", "package": null, "version": null}, {"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.salesforce.custom_persist_pass_through_columns"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity", "model.salesforce_source.stg_salesforce__user", "model.salesforce_source.stg_salesforce__user_role", "model.salesforce_source.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__opportunity_enhanced.sql", "compiled": true, "compiled_code": "with opportunity as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\n), \n\n\naccount as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\n), \n\nadd_fields as (\n\n select \n opportunity.*,\n account.account_number,\n account.account_source,\n account.industry,\n account.account_name,\n account.number_of_employees,\n account.type as account_type,\n opportunity_owner.user_id as opportunity_owner_id,\n opportunity_owner.user_name as opportunity_owner_name,\n opportunity_owner.user_role_id as opportunity_owner_role_id,\n opportunity_owner.city opportunity_owner_city,\n opportunity_owner.state as opportunity_owner_state,\n opportunity_manager.user_id as opportunity_manager_id,\n opportunity_manager.user_name as opportunity_manager_name,\n opportunity_manager.city opportunity_manager_city,\n opportunity_manager.state as opportunity_manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as opportunity_owner_position, \n user_role.developer_name as opportunity_owner_developer_name,\n user_role.parent_role_id as opportunity_owner_parent_role_id,\n user_role.rollup_description as opportunity_owner_rollup_description,\n \n\n case\n when opportunity.is_won then 'Won'\n when not opportunity.is_won and opportunity.is_closed then 'Lost'\n when not opportunity.is_closed and lower(opportunity.forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status,\n case when is_created_this_month then amount else 0 end as created_amount_this_month,\n case when is_created_this_quarter then amount else 0 end as created_amount_this_quarter,\n case when is_created_this_month then 1 else 0 end as created_count_this_month,\n case when is_created_this_quarter then 1 else 0 end as created_count_this_quarter,\n case when is_closed_this_month then amount else 0 end as closed_amount_this_month,\n case when is_closed_this_quarter then amount else 0 end as closed_amount_this_quarter,\n case when is_closed_this_month then 1 else 0 end as closed_count_this_month,\n case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter\n\n --The below script allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n \n\n\n\n\n \n\n from opportunity\n left join account \n on opportunity.account_id = account.account_id\n left join salesforce_user as opportunity_owner \n on opportunity.owner_id = opportunity_owner.user_id\n left join salesforce_user as opportunity_manager \n on opportunity_owner.manager_id = opportunity_manager.user_id\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n left join user_role \n on opportunity_owner.user_role_id = user_role.user_role_id\n \n)\n\nselect *\nfrom add_fields", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__owner_performance": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__owner_performance", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__owner_performance.sql", "original_file_path": "models/salesforce/salesforce__owner_performance.sql", "unique_id": "model.salesforce.salesforce__owner_performance", "fqn": ["salesforce", "salesforce", "salesforce__owner_performance"], "alias": "salesforce__owner_performance", "checksum": {"name": "sha256", "checksum": "b34d062ed9c77478e003931345d7248ee952d66ef88b213d4a72889c9cabba0a"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents an individual member of the sales team, enriched with data about their pipeline, bookings, loses, and win percentages.", "columns": {"owner_id": {"name": "owner_id", "description": "Id of the owner of this opportunity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_bookings_amount": {"name": "avg_bookings_amount", "description": "The average opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The average days since created across opportunties in the pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_to_close": {"name": "avg_days_to_close", "description": "The average days to close across opportunties in that have been won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_pipeline_opp_amount": {"name": "avg_pipeline_opp_amount", "description": "The average opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "b_manager_id": {"name": "b_manager_id", "description": "Manager ID of the booking_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "b_owner_id": {"name": "b_owner_id", "description": "Owner ID of the booking_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "description": "The opportunity amount, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "description": "The opportunity amount, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "description": "The opportunity count, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "description": "The opportunity count, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "l_manager_id": {"name": "l_manager_id", "description": "Manager ID of the lost_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "l_owner_id": {"name": "l_owner_id", "description": "Owner ID of the lost_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "description": "The largest amount associated with a single opportunity in the current pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_month": {"name": "lost_amount_this_month", "description": "The opportunity amount, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_month": {"name": "lost_count_this_month", "description": "The opportunity count, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_quarter": {"name": "lost_count_this_quarter", "description": "The opportunity count, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_id": {"name": "manager_id", "description": "Manager ID associated with opportunities.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_city": {"name": "owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_name": {"name": "owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_state": {"name": "owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "p_manager_id": {"name": "p_manager_id", "description": "Manager ID of the pipeline_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "p_owner_id": {"name": "p_owner_id", "description": "Owner ID of the pipeline_by_owner CTE. Helper field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "description": "The opportunity count, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "description": "The opportunity count, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "description": "The opportunity amount, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "description": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_win_percent": {"name": "total_win_percent", "description": "The booking amount closed, divided by the sum of the booking amount and the lost amount..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_month": {"name": "win_percent_this_month", "description": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_quarter": {"name": "win_percent_this_quarter", "description": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.328741, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__owner_performance\"", "raw_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from {{ ref('int_salesforce__opportunity_aggregation_by_owner') }} \n), \n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n)\n\nselect \n opportunity_aggregation_by_owner.*,\n salesforce_user.user_name as owner_name,\n salesforce_user.city as owner_city,\n salesforce_user.state as owner_state,\n case \n when (bookings_amount_closed_this_month + lost_amount_this_month) > 0 \n then bookings_amount_closed_this_month / (bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0 \n end as win_percent_this_month,\n case \n when (bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 \n then bookings_amount_closed_this_quarter / (bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0 \n end as win_percent_this_quarter,\n case \n when (total_bookings_amount + total_lost_amount) > 0 \n then total_bookings_amount / (total_bookings_amount + total_lost_amount) * 100\n else 0 \n end as total_win_percent\nfrom opportunity_aggregation_by_owner\njoin salesforce_user \n on salesforce_user.user_id = opportunity_aggregation_by_owner.owner_id", "language": "sql", "refs": [{"name": "int_salesforce__opportunity_aggregation_by_owner", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__owner_performance.sql", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\" \n), \n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n)\n\nselect \n opportunity_aggregation_by_owner.*,\n salesforce_user.user_name as owner_name,\n salesforce_user.city as owner_city,\n salesforce_user.state as owner_state,\n case \n when (bookings_amount_closed_this_month + lost_amount_this_month) > 0 \n then bookings_amount_closed_this_month / (bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0 \n end as win_percent_this_month,\n case \n when (bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 \n then bookings_amount_closed_this_quarter / (bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0 \n end as win_percent_this_quarter,\n case \n when (total_bookings_amount + total_lost_amount) > 0 \n then total_bookings_amount / (total_bookings_amount + total_lost_amount) * 100\n else 0 \n end as total_win_percent\nfrom opportunity_aggregation_by_owner\njoin salesforce_user \n on salesforce_user.user_id = opportunity_aggregation_by_owner.owner_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__opportunity_line_item_enhanced": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__opportunity_line_item_enhanced", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__opportunity_line_item_enhanced.sql", "original_file_path": "models/salesforce/salesforce__opportunity_line_item_enhanced.sql", "unique_id": "model.salesforce.salesforce__opportunity_line_item_enhanced", "fqn": ["salesforce", "salesforce", "salesforce__opportunity_line_item_enhanced"], "alias": "salesforce__opportunity_line_item_enhanced", "checksum": {"name": "sha256", "checksum": "be07c8078b92a71998ec55013b11dd184eaf1d2fcc29be8084c5076a7aa0deb9"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a line item belonging to a certain opportunity, with additional product details.", "columns": {"opportunity_line_item_id": {"name": "opportunity_line_item_id", "description": "Unique id for each record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_name": {"name": "opportunity_line_item_name", "description": "The unique name for each opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID of the associated Opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "line_item_index": {"name": "line_item_index", "description": "The index number of the specific line item, relative to all line items in that opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_line_items": {"name": "total_line_items", "description": "The total number of line items belonging to the same opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_date": {"name": "service_date", "description": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_entry_id": {"name": "pricebook_entry_id", "description": "ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_id": {"name": "product_2_id", "description": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later.\nUse the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_name": {"name": "product_2_name", "description": "Default name of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_description": {"name": "product_2_description", "description": "A text description of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "list_price": {"name": "list_price", "description": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule.\nWhen updating these records:\nIf you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant.\nIf you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unit_price": {"name": "unit_price", "description": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price.\nThis field or TotalPrice is required. You can\u2019t specify both.\n\nIf you specify Discount and Quantity, this field or TotalPrice is required.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem.\nIf you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\n\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_quantity_schedule": {"name": "has_quantity_schedule", "description": "Indicates whether a quantity schedule has been created for this object (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_revenue_schedule": {"name": "has_revenue_schedule", "description": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_external_id": {"name": "product_external_id", "description": "The unique identifier of the product in the linked external data source. For example, ID #123.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_family": {"name": "product_family", "description": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_is_active": {"name": "product_is_active", "description": "Indicates whether product is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_is_archived": {"name": "product_is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_is_deleted": {"name": "product_is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_number_of_quantity_installments": {"name": "product_number_of_quantity_installments", "description": "If the product has a quantity schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_quantity_installment_period": {"name": "product_quantity_installment_period", "description": "If the product has a quantity schedule, the amount of time covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_quantity_schedule_type": {"name": "product_quantity_schedule_type", "description": "The type of the quantity schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_quantity_unit_of_measure": {"name": "product_quantity_unit_of_measure", "description": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_number_of_revenue_installments": {"name": "product_number_of_revenue_installments", "description": "If the product has a revenue schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_revenue_installment_period": {"name": "product_revenue_installment_period", "description": "If the product has a revenue schedule, the time period covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_revenue_schedule_type": {"name": "product_revenue_schedule_type", "description": "The type of the revenue schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.347046, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"", "raw_code": "--This model will only run if you have the underlying opportunity line item table.\n{{ config(enabled=var('salesforce__opportunity_line_item_enabled', True))}}\nwith opportunity_line_item as (\n \n select *\n from {{ var('opportunity_line_item') }}\n),\n\n-- If using product_2 table, the following will be included, otherwise it will not.\n{% if var('salesforce__product_2_enabled', True) %}\nproduct_2 as (\n\n select * \n from {{ var('product_2') }}\n),\n{% endif %}\n\n\nfinal as (\n\n select\n oli.opportunity_line_item_id,\n oli.opportunity_line_item_name,\n oli.opportunity_line_item_description,\n oli.opportunity_id,\n row_number() over (partition by oli.opportunity_id order by oli.created_date) as line_item_index,\n count(opportunity_line_item_id) over (partition by oli.opportunity_id) as total_line_items,\n oli.created_date,\n oli.last_modified_date,\n oli.service_date,\n oli.pricebook_entry_id,\n oli.product_2_id,\n oli.list_price,\n oli.quantity,\n oli.unit_price,\n oli.total_price,\n oli.has_quantity_schedule,\n oli.has_revenue_schedule\n\n {% if var('salesforce__product_2_enabled', True) %}\n ,\n product_2.product_2_name,\n product_2.product_code,\n product_2.product_2_description,\n product_2.external_id as product_external_id,\n product_2.family as product_family,\n product_2.is_active as product_is_active,\n product_2.is_archived as product_is_archived,\n product_2.is_deleted as product_is_deleted,\n product_2.number_of_quantity_installments as product_number_of_quantity_installments,\n product_2.quantity_installment_period as product_quantity_installment_period,\n product_2.quantity_schedule_type as product_quantity_schedule_type,\n product_2.quantity_unit_of_measure as product_quantity_unit_of_measure,\n product_2.number_of_revenue_installments as product_number_of_revenue_installments,\n product_2.revenue_installment_period as product_revenue_installment_period,\n product_2.revenue_schedule_type as product_revenue_schedule_type\n {% endif %}\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__opportunity_line_item_pass_through_columns', identifier='oli') }}\n\n {% if var('salesforce__product_2_enabled', True) %}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__product_2_pass_through_columns', identifier='product_2') }}\n {% endif %}\n\n from opportunity_line_item as oli\n\n {% if var('salesforce__product_2_enabled', True) %}\n left join product_2\n on oli.product_2_id = product_2.product_2_id\n {% endif %}\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}, {"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_line_item", "model.salesforce_source.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__opportunity_line_item_enhanced.sql", "compiled": true, "compiled_code": "--This model will only run if you have the underlying opportunity line item table.\n\nwith opportunity_line_item as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"\n),\n\n-- If using product_2 table, the following will be included, otherwise it will not.\n\nproduct_2 as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"\n),\n\n\n\nfinal as (\n\n select\n oli.opportunity_line_item_id,\n oli.opportunity_line_item_name,\n oli.opportunity_line_item_description,\n oli.opportunity_id,\n row_number() over (partition by oli.opportunity_id order by oli.created_date) as line_item_index,\n count(opportunity_line_item_id) over (partition by oli.opportunity_id) as total_line_items,\n oli.created_date,\n oli.last_modified_date,\n oli.service_date,\n oli.pricebook_entry_id,\n oli.product_2_id,\n oli.list_price,\n oli.quantity,\n oli.unit_price,\n oli.total_price,\n oli.has_quantity_schedule,\n oli.has_revenue_schedule\n\n \n ,\n product_2.product_2_name,\n product_2.product_code,\n product_2.product_2_description,\n product_2.external_id as product_external_id,\n product_2.family as product_family,\n product_2.is_active as product_is_active,\n product_2.is_archived as product_is_archived,\n product_2.is_deleted as product_is_deleted,\n product_2.number_of_quantity_installments as product_number_of_quantity_installments,\n product_2.quantity_installment_period as product_quantity_installment_period,\n product_2.quantity_schedule_type as product_quantity_schedule_type,\n product_2.quantity_unit_of_measure as product_quantity_unit_of_measure,\n product_2.number_of_revenue_installments as product_number_of_revenue_installments,\n product_2.revenue_installment_period as product_revenue_installment_period,\n product_2.revenue_schedule_type as product_revenue_schedule_type\n \n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n \n \n\n\n\n\n \n\n from opportunity_line_item as oli\n\n \n left join product_2\n on oli.product_2_id = product_2.product_2_id\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}, "model.salesforce.salesforce__sales_snapshot": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__sales_snapshot", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__sales_snapshot.sql", "original_file_path": "models/salesforce/salesforce__sales_snapshot.sql", "unique_id": "model.salesforce.salesforce__sales_snapshot", "fqn": ["salesforce", "salesforce", "salesforce__sales_snapshot"], "alias": "salesforce__sales_snapshot", "checksum": {"name": "sha256", "checksum": "1cfeacec22cf324b8b57dad4169b8278215785ed110492e75ab82a1ffafa09a8"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "This snapshot provides monthly and quarterly metrics that help you understand how your opportunities are performing. Metrics around bookings, the current pipeline and loses are included.\n", "columns": {"avg_bookings_amount": {"name": "avg_bookings_amount", "description": "The average opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_open": {"name": "avg_days_open", "description": "The average days since created across opportunties in the pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_days_to_close": {"name": "avg_days_to_close", "description": "The average days to close across opportunties in that have been won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "avg_pipeline_opp_amount": {"name": "avg_pipeline_opp_amount", "description": "The average opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "description": "The opportunity amount, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "description": "The opportunity amount, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "description": "The opportunity count, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "description": "The opportunity count, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "description": "The largest amount associated with a single opportunity in the current pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_month": {"name": "lost_amount_this_month", "description": "The opportunity amount, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_month": {"name": "lost_count_this_month", "description": "The opportunity count, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_quarter": {"name": "lost_count_this_quarter", "description": "The opportunity count, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "description": "The opportunity count, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "description": "The opportunity count, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "description": "The opportunity amount, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "description": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_win_percent": {"name": "total_win_percent", "description": "The booking amount closed, divided by the sum of the booking amount and the lost amount..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_month": {"name": "win_percent_this_month", "description": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_quarter": {"name": "win_percent_this_quarter", "description": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.336577, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__sales_snapshot\"", "raw_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from {{ ref('salesforce__opportunity_enhanced') }}\n), \n\npipeline as (\n\n select \n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n), \n\nbookings as (\n\n select \n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n), \n\nlost as (\n\n select \n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n)\n\nselect \n bookings.*,\n pipeline.*,\n lost.*,\n case \n when (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) = 0 then null\n else round( (bookings.bookings_amount_closed_this_month / (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) ) * 100, 2 )\n end as win_percent_this_month,\n case \n when (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) = 0 then null\n else round( (bookings.bookings_amount_closed_this_quarter / (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) ) * 100, 2 ) \n end as win_percent_this_quarter,\n case \n when (bookings.total_bookings_amount + lost.total_lost_amount) = 0 then null \n else round( (bookings.total_bookings_amount / (bookings.total_bookings_amount + lost.total_lost_amount) ) * 100, 2) \n end as total_win_percent\nfrom bookings, pipeline, lost", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.salesforce__opportunity_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__sales_snapshot.sql", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\npipeline as (\n\n select \n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n), \n\nbookings as (\n\n select \n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n), \n\nlost as (\n\n select \n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n)\n\nselect \n bookings.*,\n pipeline.*,\n lost.*,\n case \n when (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) = 0 then null\n else round( (bookings.bookings_amount_closed_this_month / (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) ) * 100, 2 )\n end as win_percent_this_month,\n case \n when (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) = 0 then null\n else round( (bookings.bookings_amount_closed_this_quarter / (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) ) * 100, 2 ) \n end as win_percent_this_quarter,\n case \n when (bookings.total_bookings_amount + lost.total_lost_amount) = 0 then null \n else round( (bookings.total_bookings_amount / (bookings.total_bookings_amount + lost.total_lost_amount) ) * 100, 2) \n end as total_win_percent\nfrom bookings, pipeline, lost", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__contact_enhanced": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__contact_enhanced", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__contact_enhanced.sql", "original_file_path": "models/salesforce/salesforce__contact_enhanced.sql", "unique_id": "model.salesforce.salesforce__contact_enhanced", "fqn": ["salesforce", "salesforce", "salesforce__contact_enhanced"], "alias": "salesforce__contact_enhanced", "checksum": {"name": "sha256", "checksum": "90b63ae905189a4e582a71361dfe08380294fbc0472d787e463ed1a8e1e747d7"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a contact with additional account and owner information.", "columns": {"contact_id": {"name": "contact_id", "description": "Unique contact ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Name of contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of contact's account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_is_deleted": {"name": "contact_is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either:\nDue date of the most recent event logged against the record.\nDue date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country_code": {"name": "mailing_country_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state_code": {"name": "mailing_state_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_owner_id": {"name": "contact_owner_id", "description": "The ID of the owner of the account associated with this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true.\nThis is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_owner_name": {"name": "contact_owner_name", "description": "Name of owner of the account associated with this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_annual_revenue": {"name": "account_annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_industry": {"name": "account_industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_is_deleted": {"name": "account_is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number_of_employees": {"name": "account_number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_owner_id": {"name": "account_owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_parent_id": {"name": "account_parent_id", "description": "ID of the account parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_rating": {"name": "account_rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.33988, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_enhanced\"", "raw_code": "with contact as (\n\n select *\n from {{ var('contact') }}\n), \n\naccount as (\n\n select *\n from {{ var('account') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n)\n\nselect \n contact.contact_id,\n contact.contact_name,\n contact.account_id,\n contact.department,\n contact.contact_description,\n contact.email,\n contact.individual_id,\n contact.is_deleted as contact_is_deleted,\n contact.last_activity_date,\n contact.lead_source,\n contact.mailing_city,\n contact.mailing_country,\n contact.mailing_country_code,\n contact.mailing_postal_code,\n contact.mailing_state,\n contact.mailing_state_code,\n contact.mailing_street,\n contact.master_record_id,\n contact.mobile_phone,\n contact.owner_id as contact_owner_id,\n contact.phone,\n contact.reports_to_id,\n salesforce_user.user_name as contact_owner_name,\n account.account_name,\n account.account_number,\n account.account_source,\n account.annual_revenue as account_annual_revenue,\n account.account_description,\n account.industry as account_industry,\n account.is_deleted as account_is_deleted,\n account.number_of_employees as account_number_of_employees,\n account.owner_id as account_owner_id,\n account.parent_id as account_parent_id,\n account.rating as account_rating,\n account.type as account_type\n\n --The below scripts allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__contact_pass_through_columns', identifier='contact') }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__account_pass_through_columns', identifier='account') }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__user_pass_through_columns', identifier='salesforce_user') }}\n\nfrom contact\nleft join account \n on contact.account_id = account.account_id\nleft join salesforce_user\n on contact.owner_id = salesforce_user.user_id", "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}, {"name": "stg_salesforce__account", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce_source.stg_salesforce__contact", "model.salesforce_source.stg_salesforce__account", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__contact_enhanced.sql", "compiled": true, "compiled_code": "with contact as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"\n), \n\naccount as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n)\n\nselect \n contact.contact_id,\n contact.contact_name,\n contact.account_id,\n contact.department,\n contact.contact_description,\n contact.email,\n contact.individual_id,\n contact.is_deleted as contact_is_deleted,\n contact.last_activity_date,\n contact.lead_source,\n contact.mailing_city,\n contact.mailing_country,\n contact.mailing_country_code,\n contact.mailing_postal_code,\n contact.mailing_state,\n contact.mailing_state_code,\n contact.mailing_street,\n contact.master_record_id,\n contact.mobile_phone,\n contact.owner_id as contact_owner_id,\n contact.phone,\n contact.reports_to_id,\n salesforce_user.user_name as contact_owner_name,\n account.account_name,\n account.account_number,\n account.account_source,\n account.annual_revenue as account_annual_revenue,\n account.account_description,\n account.industry as account_industry,\n account.is_deleted as account_is_deleted,\n account.number_of_employees as account_number_of_employees,\n account.owner_id as account_owner_id,\n account.parent_id as account_parent_id,\n account.rating as account_rating,\n account.type as account_type\n\n --The below scripts allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\nfrom contact\nleft join account \n on contact.account_id = account.account_id\nleft join salesforce_user\n on contact.owner_id = salesforce_user.user_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__daily_activity": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__daily_activity", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__daily_activity.sql", "original_file_path": "models/salesforce/salesforce__daily_activity.sql", "unique_id": "model.salesforce.salesforce__daily_activity", "fqn": ["salesforce", "salesforce", "salesforce__daily_activity"], "alias": "salesforce__daily_activity", "checksum": {"name": "sha256", "checksum": "271440ed0f5c882379ea7019ab3714577e8dfdfa93a53b362b6e360ed3c8b930"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a daily summary of the number of sales activities, for example tasks and opportunities closed.", "columns": {"date_day": {"name": "date_day", "description": "Day of event, in UTC.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "leads_created": {"name": "leads_created", "description": "Number of leads created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "leads_converted": {"name": "leads_converted", "description": "Number of leads converted on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tasks_completed": {"name": "tasks_completed", "description": "Number of tasks for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "events_completed": {"name": "events_completed", "description": "Number of events for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_created": {"name": "opportunities_created", "description": "Number of opportunities created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_won": {"name": "opportunities_won", "description": "Number of opportunities won on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_lost": {"name": "opportunities_lost", "description": "Number of opportunities lost on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_created_amount": {"name": "opportunities_created_amount", "description": "The dollar amount of all opportunities created for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_won_amount": {"name": "opportunities_won_amount", "description": "The dollar amount of all opportunities won for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunities_lost_amount": {"name": "opportunities_lost_amount", "description": "The dollar amount of all opportunities lost for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_amount": {"name": "pipeline_amount", "description": "The dollar amount of all opportunities in the pipeline for this day.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.3420002, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__daily_activity\"", "raw_code": "with date_spine as (\n \n select \n {{ dbt.date_trunc('day', 'date_day') }} as date_day\n from {{ ref('int_salesforce__date_spine') }}\n),\n\n{% if var('salesforce__task_enabled', True) %}\ntask as (\n \n select \n {{ dbt.date_trunc('day', 'activity_date') }} as activity_date,\n count(task_id) as tasks_completed\n from {{ var('task') }}\n group by 1\n), \n{% endif %}\n\n{% if var('salesforce__event_enabled', True) %}\nsalesforce_event as (\n\n select \n coalesce({{ dbt.date_trunc('day', 'activity_date') }}, {{ dbt.date_trunc('day', 'activity_date_time') }}) as activity_date,\n count(event_id) as events_completed\n from {{ var('event') }}\n group by 1\n), \n{% endif %}\n\n{% if var('salesforce__lead_enabled', True) %}\nsalesforce_lead as (\n\n select \n {{ dbt.date_trunc('day', 'created_date') }} as created_date,\n count(lead_id) as leads_created \n from {{ var('lead') }}\n group by 1\n), \n\nsalesforce_converted_lead as (\n\n select \n {{ dbt.date_trunc('day', 'converted_date') }} as converted_date,\n count(lead_id) as leads_converted\n from {{ var('lead') }}\n where is_converted\n group by 1\n), \n{% endif %}\n\nopportunity as (\n\n select \n opportunity_id,\n {{ dbt.date_trunc('day', 'created_date') }} as created_date,\n account_id,\n {{ dbt.date_trunc('day', 'close_date') }} as close_date,\n is_closed,\n is_deleted,\n is_won,\n owner_id, \n stage_name,\n type,\n amount,\n case\n when is_won then 'Won'\n when not is_won and is_closed then 'Lost'\n when not is_closed and lower(forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status\n from {{ var('opportunity') }}\n),\n\nopportunities_created as (\n\n select\n created_date,\n count(opportunity_id) as opportunities_created,\n round(sum(amount)) as opportunities_created_amount\n from opportunity\n group by 1\n),\n\nopportunities_closed as (\n\n select\n close_date,\n count(case when status = 'Won' then opportunity_id else null end) as opportunities_won,\n round(sum(case when status = 'Won' then amount else 0 end)) as opportunities_won_amount,\n count(case when status = 'Lost' then opportunity_id else null end) as opportunities_lost,\n round(sum(case when status = 'Lost' then amount else null end)) as opportunities_lost_amount,\n round(sum(case when status = 'Pipeline' then amount else null end)) as pipeline_amount\n from opportunity\n group by 1\n)\n\nselect\n date_spine.date_day,\n\n {% if var('salesforce__lead_enabled', True) %}\n salesforce_lead.leads_created,\n salesforce_converted_lead.leads_converted,\n {% endif %}\n \n {% if var('salesforce__task_enabled', True) %}\n task.tasks_completed,\n {% endif %}\n\n {% if var('salesforce__event_enabled', True) %}\n salesforce_event.events_completed,\n {% endif %}\n\n opportunities_created.opportunities_created,\n opportunities_created.opportunities_created_amount,\n opportunities_closed.opportunities_won,\n opportunities_closed.opportunities_won_amount,\n opportunities_closed.opportunities_lost,\n opportunities_closed.opportunities_lost_amount,\n opportunities_closed.pipeline_amount\nfrom date_spine\n\n{% if var('salesforce__lead_enabled', True) %}\nleft join salesforce_lead\n on date_spine.date_day = salesforce_lead.created_date\nleft join salesforce_converted_lead\n on date_spine.date_day = salesforce_converted_lead.converted_date\n{% endif %}\n\n{% if var('salesforce__task_enabled', True) %}\nleft join task\n on date_spine.date_day = task.activity_date\n{% endif %}\n\n{% if var('salesforce__event_enabled', True) %}\nleft join salesforce_event\n on date_spine.date_day = salesforce_event.activity_date\n{% endif %}\n\nleft join opportunities_created\n on date_spine.date_day = opportunities_created.created_date\nleft join opportunities_closed\n on date_spine.date_day = opportunities_closed.close_date", "language": "sql", "refs": [{"name": "int_salesforce__date_spine", "package": null, "version": null}, {"name": "stg_salesforce__task", "package": null, "version": null}, {"name": "stg_salesforce__event", "package": null, "version": null}, {"name": "stg_salesforce__lead", "package": null, "version": null}, {"name": "stg_salesforce__lead", "package": null, "version": null}, {"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.salesforce.int_salesforce__date_spine", "model.salesforce_source.stg_salesforce__task", "model.salesforce_source.stg_salesforce__event", "model.salesforce_source.stg_salesforce__lead", "model.salesforce_source.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__daily_activity.sql", "compiled": true, "compiled_code": "with date_spine as (\n \n select \n date_trunc('day', date_day) as date_day\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__date_spine\"\n),\n\n\ntask as (\n \n select \n date_trunc('day', activity_date) as activity_date,\n count(task_id) as tasks_completed\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"\n group by 1\n), \n\n\n\nsalesforce_event as (\n\n select \n coalesce(date_trunc('day', activity_date), date_trunc('day', activity_date_time)) as activity_date,\n count(event_id) as events_completed\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\"\n group by 1\n), \n\n\n\nsalesforce_lead as (\n\n select \n date_trunc('day', created_date) as created_date,\n count(lead_id) as leads_created \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\n group by 1\n), \n\nsalesforce_converted_lead as (\n\n select \n date_trunc('day', converted_date) as converted_date,\n count(lead_id) as leads_converted\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\n where is_converted\n group by 1\n), \n\n\nopportunity as (\n\n select \n opportunity_id,\n date_trunc('day', created_date) as created_date,\n account_id,\n date_trunc('day', close_date) as close_date,\n is_closed,\n is_deleted,\n is_won,\n owner_id, \n stage_name,\n type,\n amount,\n case\n when is_won then 'Won'\n when not is_won and is_closed then 'Lost'\n when not is_closed and lower(forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\n),\n\nopportunities_created as (\n\n select\n created_date,\n count(opportunity_id) as opportunities_created,\n round(sum(amount)) as opportunities_created_amount\n from opportunity\n group by 1\n),\n\nopportunities_closed as (\n\n select\n close_date,\n count(case when status = 'Won' then opportunity_id else null end) as opportunities_won,\n round(sum(case when status = 'Won' then amount else 0 end)) as opportunities_won_amount,\n count(case when status = 'Lost' then opportunity_id else null end) as opportunities_lost,\n round(sum(case when status = 'Lost' then amount else null end)) as opportunities_lost_amount,\n round(sum(case when status = 'Pipeline' then amount else null end)) as pipeline_amount\n from opportunity\n group by 1\n)\n\nselect\n date_spine.date_day,\n\n \n salesforce_lead.leads_created,\n salesforce_converted_lead.leads_converted,\n \n \n \n task.tasks_completed,\n \n\n \n salesforce_event.events_completed,\n \n\n opportunities_created.opportunities_created,\n opportunities_created.opportunities_created_amount,\n opportunities_closed.opportunities_won,\n opportunities_closed.opportunities_won_amount,\n opportunities_closed.opportunities_lost,\n opportunities_closed.opportunities_lost_amount,\n opportunities_closed.pipeline_amount\nfrom date_spine\n\n\nleft join salesforce_lead\n on date_spine.date_day = salesforce_lead.created_date\nleft join salesforce_converted_lead\n on date_spine.date_day = salesforce_converted_lead.converted_date\n\n\n\nleft join task\n on date_spine.date_day = task.activity_date\n\n\n\nleft join salesforce_event\n on date_spine.date_day = salesforce_event.activity_date\n\n\nleft join opportunities_created\n on date_spine.date_day = opportunities_created.created_date\nleft join opportunities_closed\n on date_spine.date_day = opportunities_closed.close_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.salesforce__manager_performance": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "salesforce__manager_performance", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__manager_performance.sql", "original_file_path": "models/salesforce/salesforce__manager_performance.sql", "unique_id": "model.salesforce.salesforce__manager_performance", "fqn": ["salesforce", "salesforce", "salesforce__manager_performance"], "alias": "salesforce__manager_performance", "checksum": {"name": "sha256", "checksum": "6f0d9523b9b4511b8026510e3d837bfe7468c1981b95e61ded9c3f53bc309768"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents a manager, enriched with data about their team's pipeline, bookings, loses, and win percentages.", "columns": {"manager_id": {"name": "manager_id", "description": "The user id of the manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "description": "The opportunity amount, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "description": "The opportunity amount, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "description": "The opportunity count, if closed this month and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "description": "The opportunity count, if closed this quarter and status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "description": "The largest amount associated with a single opportunity in the current pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_month": {"name": "lost_amount_this_month", "description": "The opportunity amount, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_month": {"name": "lost_count_this_month", "description": "The opportunity count, if closed this month and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lost_count_this_quarter": {"name": "lost_count_this_quarter", "description": "The opportunity count, if closed this quarter and status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_city": {"name": "manager_city", "description": "The city location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_name": {"name": "manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_position": {"name": "manager_position", "description": "The position role of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_state": {"name": "manager_state", "description": "The state location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_direct_reports": {"name": "number_of_direct_reports", "description": "The number of opportunity owners who report to this manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "description": "The opportunity count, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "description": "The opportunity count, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "description": "The opportunity amount, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "description": "The opportunity amount, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "description": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "description": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_win_percent": {"name": "total_win_percent", "description": "The booking amount closed, divided by the sum of the booking amount and the lost amount..", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_month": {"name": "win_percent_this_month", "description": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "win_percent_this_quarter": {"name": "win_percent_this_quarter", "description": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.325473, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__manager_performance\"", "raw_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from {{ ref('int_salesforce__opportunity_aggregation_by_owner') }}\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n{% if var('salesforce__user_role_enabled', True) %}\nuser_role as (\n\n select *\n from {{ var('user_role') }}\n),\n{% endif %}\n\nsalesforce_user as (\n\n select *\n from {{ var('user') }}\n)\n\nselect \n coalesce(manager.user_id, 'No Manager Assigned') as manager_id,\n coalesce(manager.user_name, 'No Manager Assigned') as manager_name,\n manager.city as manager_city,\n manager.state as manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n {% if var('salesforce__user_role_enabled', True) %}\n user_role.user_role_name as manager_position,\n {% endif %}\n\n count(distinct owner_id) as number_of_direct_reports,\n coalesce(sum(bookings_amount_closed_this_month), 0) as bookings_amount_closed_this_month,\n coalesce(sum(bookings_amount_closed_this_quarter), 0) as bookings_amount_closed_this_quarter,\n coalesce(sum(total_number_bookings), 0) as total_number_bookings,\n coalesce(sum(total_bookings_amount), 0) as total_bookings_amount,\n coalesce(sum(bookings_count_closed_this_month), 0) as bookings_count_closed_this_month,\n coalesce(sum(bookings_count_closed_this_quarter), 0) as bookings_count_closed_this_quarter,\n coalesce(max(largest_booking), 0) as largest_booking,\n coalesce(sum(lost_amount_this_month), 0) as lost_amount_this_month,\n coalesce(sum(lost_amount_this_quarter), 0) as lost_amount_this_quarter,\n coalesce(sum(total_number_lost), 0) as total_number_lost,\n coalesce(sum(total_lost_amount), 0) as total_lost_amount,\n coalesce(sum(lost_count_this_month), 0) as lost_count_this_month,\n coalesce(sum(lost_count_this_quarter), 0) as lost_count_this_quarter,\n coalesce(sum(pipeline_created_amount_this_month), 0) as pipeline_created_amount_this_month,\n coalesce(sum(pipeline_created_amount_this_quarter), 0) as pipeline_created_amount_this_quarter,\n coalesce(sum(pipeline_created_forecast_amount_this_month), 0) as pipeline_created_forecast_amount_this_month,\n coalesce(sum(pipeline_created_forecast_amount_this_quarter), 0) as pipeline_created_forecast_amount_this_quarter,\n coalesce(sum(pipeline_count_created_this_month), 0) as pipeline_count_created_this_month,\n coalesce(sum(pipeline_count_created_this_quarter), 0) as pipeline_count_created_this_quarter,\n coalesce(sum(total_number_pipeline), 0) as total_number_pipeline,\n coalesce(sum(total_pipeline_amount), 0) as total_pipeline_amount,\n coalesce(sum(total_pipeline_forecast_amount), 0) as total_pipeline_forecast_amount,\n coalesce(max(largest_deal_in_pipeline), 0) as largest_deal_in_pipeline,\n round(case \n when sum(bookings_amount_closed_this_month + lost_amount_this_month) > 0 then\n sum(bookings_amount_closed_this_month) / sum(bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0\n end, 2) as win_percent_this_month,\n round(case\n when sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 then\n sum(bookings_amount_closed_this_quarter) / sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0\n end, 2) as win_percent_this_quarter,\n round(case\n when sum(total_bookings_amount + total_lost_amount) > 0 then\n sum(total_bookings_amount) / sum(total_bookings_amount + total_lost_amount) * 100\n else 0\n end, 2) as total_win_percent\n\nfrom opportunity_aggregation_by_owner\nleft join salesforce_user as manager\n on manager.user_id = opportunity_aggregation_by_owner.manager_id\n\n-- If using user_role table, the following will be included, otherwise it will not.\n{% if var('salesforce__user_role_enabled', True) %}\nleft join user_role\n on manager.user_role_id = user_role.user_role_id\n\ngroup by 1, 2, 3, 4, 5\n\n{% else %}\ngroup by 1, 2, 3, 4\n\n{% endif %}\n\nhaving count(distinct owner_id) > 0", "language": "sql", "refs": [{"name": "int_salesforce__opportunity_aggregation_by_owner", "package": null, "version": null}, {"name": "stg_salesforce__user_role", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user_role", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__manager_performance.sql", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\n),\n\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n)\n\nselect \n coalesce(manager.user_id, 'No Manager Assigned') as manager_id,\n coalesce(manager.user_name, 'No Manager Assigned') as manager_name,\n manager.city as manager_city,\n manager.state as manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as manager_position,\n \n\n count(distinct owner_id) as number_of_direct_reports,\n coalesce(sum(bookings_amount_closed_this_month), 0) as bookings_amount_closed_this_month,\n coalesce(sum(bookings_amount_closed_this_quarter), 0) as bookings_amount_closed_this_quarter,\n coalesce(sum(total_number_bookings), 0) as total_number_bookings,\n coalesce(sum(total_bookings_amount), 0) as total_bookings_amount,\n coalesce(sum(bookings_count_closed_this_month), 0) as bookings_count_closed_this_month,\n coalesce(sum(bookings_count_closed_this_quarter), 0) as bookings_count_closed_this_quarter,\n coalesce(max(largest_booking), 0) as largest_booking,\n coalesce(sum(lost_amount_this_month), 0) as lost_amount_this_month,\n coalesce(sum(lost_amount_this_quarter), 0) as lost_amount_this_quarter,\n coalesce(sum(total_number_lost), 0) as total_number_lost,\n coalesce(sum(total_lost_amount), 0) as total_lost_amount,\n coalesce(sum(lost_count_this_month), 0) as lost_count_this_month,\n coalesce(sum(lost_count_this_quarter), 0) as lost_count_this_quarter,\n coalesce(sum(pipeline_created_amount_this_month), 0) as pipeline_created_amount_this_month,\n coalesce(sum(pipeline_created_amount_this_quarter), 0) as pipeline_created_amount_this_quarter,\n coalesce(sum(pipeline_created_forecast_amount_this_month), 0) as pipeline_created_forecast_amount_this_month,\n coalesce(sum(pipeline_created_forecast_amount_this_quarter), 0) as pipeline_created_forecast_amount_this_quarter,\n coalesce(sum(pipeline_count_created_this_month), 0) as pipeline_count_created_this_month,\n coalesce(sum(pipeline_count_created_this_quarter), 0) as pipeline_count_created_this_quarter,\n coalesce(sum(total_number_pipeline), 0) as total_number_pipeline,\n coalesce(sum(total_pipeline_amount), 0) as total_pipeline_amount,\n coalesce(sum(total_pipeline_forecast_amount), 0) as total_pipeline_forecast_amount,\n coalesce(max(largest_deal_in_pipeline), 0) as largest_deal_in_pipeline,\n round(case \n when sum(bookings_amount_closed_this_month + lost_amount_this_month) > 0 then\n sum(bookings_amount_closed_this_month) / sum(bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0\n end, 2) as win_percent_this_month,\n round(case\n when sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 then\n sum(bookings_amount_closed_this_quarter) / sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0\n end, 2) as win_percent_this_quarter,\n round(case\n when sum(total_bookings_amount + total_lost_amount) > 0 then\n sum(total_bookings_amount) / sum(total_bookings_amount + total_lost_amount) * 100\n else 0\n end, 2) as total_win_percent\n\nfrom opportunity_aggregation_by_owner\nleft join salesforce_user as manager\n on manager.user_id = opportunity_aggregation_by_owner.manager_id\n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nleft join user_role\n on manager.user_role_id = user_role.user_role_id\n\ngroup by 1, 2, 3, 4, 5\n\n\n\nhaving count(distinct owner_id) > 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}, "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "int_salesforce__opportunity_aggregation_by_owner", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/intermediate/int_salesforce__opportunity_aggregation_by_owner.sql", "original_file_path": "models/salesforce/intermediate/int_salesforce__opportunity_aggregation_by_owner.sql", "unique_id": "model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "fqn": ["salesforce", "salesforce", "intermediate", "int_salesforce__opportunity_aggregation_by_owner"], "alias": "int_salesforce__opportunity_aggregation_by_owner", "checksum": {"name": "sha256", "checksum": "1e6d96e6ac108cbdcfad6fc0f6281f3fb0bd595389a17b76154e790e92c3295d"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770461.810153, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\"", "raw_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from {{ ref('salesforce__opportunity_enhanced') }}\n), \n\nsalesforce_user as (\n\n select * \n from {{ var('user') }}\n), \n\nbooking_by_owner as (\n\n select \n opportunity_manager_id as b_manager_id,\n opportunity_owner_id as b_owner_id,\n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n group by 1, 2\n), \n\nlost_by_owner as (\n\n select \n opportunity_manager_id as l_manager_id,\n opportunity_owner_id as l_owner_id,\n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n group by 1, 2\n), \n\npipeline_by_owner as (\n\n select \n opportunity_manager_id as p_manager_id,\n opportunity_owner_id as p_owner_id,\n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n group by 1, 2\n)\n\nselect \n salesforce_user.user_id as owner_id,\n coalesce(p_manager_id, b_manager_id, l_manager_id) as manager_id,\n booking_by_owner.*,\n lost_by_owner.*,\n pipeline_by_owner.*\nfrom salesforce_user\nleft join booking_by_owner \n on booking_by_owner.b_owner_id = salesforce_user.user_id\nleft join lost_by_owner \n on lost_by_owner.l_owner_id = salesforce_user.user_id\nleft join pipeline_by_owner \n on pipeline_by_owner.p_owner_id = salesforce_user.user_id", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/intermediate/int_salesforce__opportunity_aggregation_by_owner.sql", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\nsalesforce_user as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n), \n\nbooking_by_owner as (\n\n select \n opportunity_manager_id as b_manager_id,\n opportunity_owner_id as b_owner_id,\n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n group by 1, 2\n), \n\nlost_by_owner as (\n\n select \n opportunity_manager_id as l_manager_id,\n opportunity_owner_id as l_owner_id,\n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n group by 1, 2\n), \n\npipeline_by_owner as (\n\n select \n opportunity_manager_id as p_manager_id,\n opportunity_owner_id as p_owner_id,\n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n group by 1, 2\n)\n\nselect \n salesforce_user.user_id as owner_id,\n coalesce(p_manager_id, b_manager_id, l_manager_id) as manager_id,\n booking_by_owner.*,\n lost_by_owner.*,\n pipeline_by_owner.*\nfrom salesforce_user\nleft join booking_by_owner \n on booking_by_owner.b_owner_id = salesforce_user.user_id\nleft join lost_by_owner \n on lost_by_owner.l_owner_id = salesforce_user.user_id\nleft join pipeline_by_owner \n on pipeline_by_owner.p_owner_id = salesforce_user.user_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce.int_salesforce__date_spine": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "int_salesforce__date_spine", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/intermediate/int_salesforce__date_spine.sql", "original_file_path": "models/salesforce/intermediate/int_salesforce__date_spine.sql", "unique_id": "model.salesforce.int_salesforce__date_spine", "fqn": ["salesforce", "salesforce", "intermediate", "int_salesforce__date_spine"], "alias": "int_salesforce__date_spine", "checksum": {"name": "sha256", "checksum": "b5fabd3efffdaf208c1c35cf50000c765b4c7af49285430cda5b55885d5b9752"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770461.814239, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__date_spine\"", "raw_code": "{% if var('salesforce__lead_enabled', True) -%}\n-- depends_on: {{ var('lead') }}\n{% else -%}\n-- depends_on: {{ var('opportunity') }}\n{% endif %} \nwith spine as (\n\n {% if execute and flags.WHICH in ('run', 'build') %}\n\n {%- set first_date_query %}\n select \n coalesce(\n min(cast(created_date as date)), \n cast({{ dbt.dateadd(\"month\", -1, \"current_date\") }} as date)\n ) as min_date\n {% if var('salesforce__lead_enabled', True) %}\n from {{ var('lead') }}\n {% else %}\n from {{ var('opportunity') }}\n {% endif %} \n {% endset -%}\n\n {% set last_date_query %}\n select \n coalesce(\n greatest(max(cast(created_date as date)), cast(current_date as date)),\n cast(current_date as date)\n ) as max_date\n {% if var('salesforce__lead_enabled', True) %}\n from {{ var('lead') }}\n {% else %}\n from {{ var('opportunity') }}\n {% endif %} \n {% endset -%}\n\n {% else %}\n\n {%- set first_date_query%}\n select cast({{ dbt.dateadd(\"month\", -1, \"current_date\") }} as date)\n {% endset -%}\n\n {% set last_date_query %}\n select cast({{ dbt.current_timestamp_backcompat() }} as date)\n {% endset -%}\n\n {% endif %}\n\n {%- set first_date = dbt_utils.get_single_value(first_date_query) %}\n {%- set last_date = dbt_utils.get_single_value(last_date_query) %}\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date=\"cast('\" ~ first_date ~ \"' as date)\",\n end_date=dbt.dateadd(\"day\", 1, \"cast('\" ~ last_date ~ \"' as date)\")\n )\n }}\n)\n\nselect * \nfrom spine", "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat", "macro.dbt_utils.get_single_value", "macro.dbt_utils.date_spine"], "nodes": ["model.salesforce_source.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/intermediate/int_salesforce__date_spine.sql", "compiled": true, "compiled_code": "-- depends_on: \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\n \nwith spine as (\n\n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 31\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2024-06-23' as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= \n\n cast('2024-07-23' as date) + ((interval '1 day') * (1))\n\n\n\n)\n\nselect * from filtered\n\n\n)\n\nselect * \nfrom spine", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__opportunity_history": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__opportunity_history", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce_history/stg_salesforce__opportunity_history.sql", "original_file_path": "models/salesforce_history/stg_salesforce__opportunity_history.sql", "unique_id": "model.salesforce_source.stg_salesforce__opportunity_history", "fqn": ["salesforce_source", "salesforce_history", "stg_salesforce__opportunity_history"], "alias": "stg_salesforce__opportunity_history", "checksum": {"name": "sha256", "checksum": "cedc11f02f20dbf84230c35bffecadd658b05c6e7bec647507865b762661e6d7"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "history_unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Represents historical records of opportunities, which are sales or pending deals.", "columns": {"opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_date": {"name": "_fivetran_date", "description": "The date when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce_history/stg_salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "unique_key": "history_unique_key", "incremental_strategy": "delete+insert", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.371348, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"", "raw_code": "{{ config(\n enabled=var('salesforce__opportunity_history_enabled', False),\n materialized='incremental',\n unique_key='history_unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\n \"field\": \"_fivetran_date\", \n \"data_type\": \"date\"\n } if target.type not in ('spark','databricks') else ['_fivetran_date'],\n file_format='parquet',\n on_schema_change='fail'\n ) \n}}\n\nwith base as (\n\n select * \n from {{ source('salesforce_history','opportunity') }}\n {% if is_incremental() %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% else %}\n {% if var('global_history_start_date',[]) or var('opportunity_history_start_date',[]) %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= \n {% if var('opportunity_history_start_date', []) %}\n \"{{ var('opportunity_history_start_date') }}\"\n {% else %}\n \"{{ var('global_history_start_date') }}\"\n {% endif %}\n {% endif %}\n {% endif %} \n),\n\nfinal as (\n\n select \n id as opportunity_id,\n cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start,\n cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key,\n\n {{ dbt_utils.star(from=source('salesforce_history','opportunity'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n from base\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce_history", "opportunity"], ["salesforce_history", "opportunity"]], "metrics": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce_source.salesforce_history.opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce__opportunity_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_salesforce\".\"sf_opportunity_history_data\"\n \n \n \n),\n\nfinal as (\n\n select \n id as opportunity_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"amount\",\n \"campaign_id\",\n \"close_date\",\n \"created_date\",\n \"description\",\n \"expected_revenue\",\n \"fiscal\",\n \"fiscal_quarter\",\n \"fiscal_year\",\n \"forecast_category\",\n \"forecast_category_name\",\n \"has_open_activity\",\n \"has_opportunity_line_item\",\n \"has_overdue_task\",\n \"is_closed\",\n \"is_deleted\",\n \"is_won\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"lead_source\",\n \"name\",\n \"next_step\",\n \"owner_id\",\n \"probability\",\n \"record_type_id\",\n \"stage_name\",\n \"synced_quote_id\",\n \"type\"\n from base\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}, "model.salesforce_source.stg_salesforce__account_history": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__account_history", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce_history/stg_salesforce__account_history.sql", "original_file_path": "models/salesforce_history/stg_salesforce__account_history.sql", "unique_id": "model.salesforce_source.stg_salesforce__account_history", "fqn": ["salesforce_source", "salesforce_history", "stg_salesforce__account_history"], "alias": "stg_salesforce__account_history", "checksum": {"name": "sha256", "checksum": "dcce3ab61cac84fa621d4e07fb13c7c8138fa506832c326d31f0eef29d2d8492"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "history_unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Represents historical records of individual accounts, which are organizations or people involved with your business (such as customers, competitors, and partners).", "columns": {"account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_date": {"name": "_fivetran_date", "description": "The date when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce_history/stg_salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "unique_key": "history_unique_key", "incremental_strategy": "delete+insert", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.3689651, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"", "raw_code": "{{ config(\n enabled= var('salesforce__account_history_enabled', False),\n materialized='incremental',\n unique_key='history_unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\n \"field\": \"_fivetran_date\", \n \"data_type\": \"date\"\n } if target.type not in ('spark','databricks') else ['_fivetran_date'],\n file_format='parquet',\n on_schema_change='fail'\n )\n}}\n\nwith base as (\n\n select * \n from {{ source('salesforce_history', 'account') }}\n {% if is_incremental() %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% else %}\n {% if var('global_history_start_date',[]) or var('account_history_start_date',[]) %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= \n {% if var('account_history_start_date', []) %}\n \"{{ var('account_history_start_date') }}\"\n {% else %}\n \"{{ var('global_history_start_date') }}\"\n {% endif %}\n {% endif %}\n {% endif %} \n),\n\nfinal as (\n\n select \n id as account_id,\n cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start,\n cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key,\n\n {{ dbt_utils.star(from=source('salesforce_history','account'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n from base\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce_history", "account"], ["salesforce_history", "account"]], "metrics": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce_source.salesforce_history.account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce__account_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_salesforce\".\"sf_account_history_data\"\n \n \n \n),\n\nfinal as (\n\n select \n id as account_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_number\",\n \"account_source\",\n \"annual_revenue\",\n \"billing_city\",\n \"billing_country\",\n \"billing_postal_code\",\n \"billing_state\",\n \"billing_street\",\n \"description\",\n \"industry\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"master_record_id\",\n \"name\",\n \"number_of_employees\",\n \"owner_id\",\n \"ownership\",\n \"parent_id\",\n \"rating\",\n \"record_type_id\",\n \"shipping_city\",\n \"shipping_country\",\n \"shipping_postal_code\",\n \"shipping_state\",\n \"shipping_street\",\n \"type\",\n \"website\"\n from base\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}, "model.salesforce_source.stg_salesforce__contact_history": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__contact_history", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce_history/stg_salesforce__contact_history.sql", "original_file_path": "models/salesforce_history/stg_salesforce__contact_history.sql", "unique_id": "model.salesforce_source.stg_salesforce__contact_history", "fqn": ["salesforce_source", "salesforce_history", "stg_salesforce__contact_history"], "alias": "stg_salesforce__contact_history", "checksum": {"name": "sha256", "checksum": "4c54e59e30090bd2518713a07ac527dac8730b36111e56f7894154e3c1dcadb8"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": "delete+insert", "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "history_unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet"}, "tags": [], "description": "Represents the historical record of contacts, which are people associated with an account.", "columns": {"contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_date": {"name": "_fivetran_date", "description": "The date when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce_history/stg_salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "unique_key": "history_unique_key", "incremental_strategy": "delete+insert", "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "parquet", "on_schema_change": "fail", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.3700302, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"", "raw_code": "{{ config(\n enabled=var('salesforce__contact_history_enabled', False),\n materialized='incremental',\n unique_key='history_unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\n \"field\": \"_fivetran_date\", \n \"data_type\": \"date\"\n } if target.type not in ('spark','databricks') else ['_fivetran_date'],\n file_format='parquet',\n on_schema_change='fail'\n ) \n}}\n\nwith base as (\n\n select * \n from {{ source('salesforce_history', 'contact') }}\n {% if is_incremental() %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= (select max(cast((_fivetran_start) as {{ dbt.type_timestamp() }})) from {{ this }} )\n {% else %}\n {% if var('global_history_start_date',[]) or var('contact_history_start_date',[]) %}\n where cast(_fivetran_start as {{ dbt.type_timestamp() }}) >= \n {% if var('contact_history_start_date', []) %}\n \"{{ var('contact_history_start_date') }}\"\n {% else %}\n \"{{ var('global_history_start_date') }}\"\n {% endif %}\n {% endif %}\n {% endif %} \n),\n\nfinal as (\n\n select \n id as contact_id,\n cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start,\n cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key,\n\n {{ dbt_utils.star(from=source('salesforce_history','contact'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n from base\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce_history", "contact"], ["salesforce_history", "contact"]], "metrics": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce_source.salesforce_history.contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce__contact_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_salesforce\".\"sf_contact_history_data\"\n \n \n \n),\n\nfinal as (\n\n select \n id as contact_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"email\",\n \"first_name\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_modified_by_id\",\n \"last_modified_date\",\n \"last_name\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"mailing_city\",\n \"mailing_country\",\n \"mailing_country_code\",\n \"mailing_postal_code\",\n \"mailing_state\",\n \"mailing_street\",\n \"master_record_id\",\n \"mobile_phone\",\n \"name\",\n \"owner_id\",\n \"phone\",\n \"reports_to_id\",\n \"title\",\n \"lead_source\",\n \"description\",\n \"individual_id\",\n \"home_phone\"\n from base\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}, "model.salesforce_source.stg_salesforce__opportunity": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__opportunity", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__opportunity.sql", "original_file_path": "models/salesforce/stg_salesforce__opportunity.sql", "unique_id": "model.salesforce_source.stg_salesforce__opportunity", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__opportunity"], "alias": "stg_salesforce__opportunity", "checksum": {"name": "sha256", "checksum": "90a89ad6ce124dc98f631428d608b7a4e35debbde1744d1a2da8e54caf1214a7"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an opportunity, which is a sale or pending deal.", "columns": {"opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close. The Close Date will change as you work the sale. It should never be set in stone as it affects your sales pipeline, and it should never be in the past.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_excluded_from_territory_2_filter": {"name": "is_excluded_from_territory_2_filter", "description": "Used for Filter-Based Opportunity Territory Assignment. Indicates whether the opportunity is excluded (True) or included (False) each time the APEX filter is executed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "Pricebook2Id": {"name": "Pricebook2Id", "description": "ID of a related Pricebook2 object. The Pricebook2Id field indicates which Pricebook2 applies to this opportunity. The Pricebook2Id field is defined only for those organizations that have products enabled as a feature. You can specify values for only one field (Pricebook2Id or PricebookId)\u2014not both fields. For this reason, both fields are declared nillable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Unavailable as of version 3.0. As of version 8.0, the Pricebook object is no longer available. Use the Pricebook2Id field instead, specifying the ID of the Pricebook2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "territory_2_id": {"name": "territory_2_id", "description": "The ID of the territory that is assigned to the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_month": {"name": "is_created_this_month", "description": "Yes, if the opportunity created date is in the current month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_created_this_quarter": {"name": "is_created_this_quarter", "description": "Yes, if the opportunity created date is in the current quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_since_created": {"name": "days_since_created", "description": "The difference, in days, between the opportunity created date and the current timestamp.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_close": {"name": "days_to_close", "description": "The difference, in days, between the opportunity created date and the opportunity close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_month": {"name": "is_closed_this_month", "description": "Yes, if the opportunity close date is in the current month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed_this_quarter": {"name": "is_closed_this_quarter", "description": "Yes, if the opportunity close date is in the current quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.454924, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"", "raw_code": "{% set opportunity_column_list = get_opportunity_columns() -%}\n{% set opportunity_dict = column_list_to_dict(opportunity_column_list) -%}\n\nwith fields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','opportunity')),\n staging_columns=opportunity_column_list\n )\n }}\n\n from {{ source('salesforce','opportunity') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"account_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"amount\", opportunity_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"campaign_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"close_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", opportunity_dict, alias=\"opportunity_description\") }},\n {{ salesforce_source.coalesce_rename(\"expected_revenue\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"fiscal\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"fiscal_quarter\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"fiscal_year\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"forecast_category\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"forecast_category_name\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_open_activity\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_opportunity_line_item\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_overdue_task\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"id\", opportunity_dict, alias=\"opportunity_id\") }},\n {{ salesforce_source.coalesce_rename(\"is_closed\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_won\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"lead_source\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", opportunity_dict, alias=\"opportunity_name\") }},\n {{ salesforce_source.coalesce_rename(\"next_step\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"probability\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"stage_name\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"synced_quote_id\", opportunity_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", opportunity_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__opportunity_pass_through_columns') }}\n\n from fields\n where coalesce(_fivetran_active, true)\n), \n\ncalculated as (\n \n select \n *,\n created_date >= {{ dbt.date_trunc('month', dbt.current_timestamp_backcompat()) }} as is_created_this_month,\n created_date >= {{ dbt.date_trunc('quarter', dbt.current_timestamp_backcompat()) }} as is_created_this_quarter,\n {{ dbt.datediff(dbt.current_timestamp_backcompat(), 'created_date', 'day') }} as days_since_created,\n {{ dbt.datediff('close_date', 'created_date', 'day') }} as days_to_close,\n {{ dbt.date_trunc('month', 'close_date') }} = {{ dbt.date_trunc('month', dbt.current_timestamp_backcompat()) }} as is_closed_this_month,\n {{ dbt.date_trunc('quarter', 'close_date') }} = {{ dbt.date_trunc('quarter', dbt.current_timestamp_backcompat()) }} as is_closed_this_quarter\n from final\n)\n\nselect * \nfrom calculated\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "opportunity"], ["salesforce", "opportunity"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_opportunity_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns", "macro.dbt.current_timestamp_backcompat", "macro.dbt.date_trunc", "macro.dbt.datediff"], "nodes": ["source.salesforce_source.salesforce.opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__opportunity.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n close_date\n \n as \n \n close_date\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n expected_revenue\n \n as \n \n expected_revenue\n \n, \n \n \n fiscal\n \n as \n \n fiscal\n \n, \n \n \n fiscal_quarter\n \n as \n \n fiscal_quarter\n \n, \n \n \n fiscal_year\n \n as \n \n fiscal_year\n \n, \n \n \n forecast_category\n \n as \n \n forecast_category\n \n, \n \n \n forecast_category_name\n \n as \n \n forecast_category_name\n \n, \n \n \n has_open_activity\n \n as \n \n has_open_activity\n \n, \n \n \n has_opportunity_line_item\n \n as \n \n has_opportunity_line_item\n \n, \n \n \n has_overdue_task\n \n as \n \n has_overdue_task\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_won\n \n as \n \n is_won\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n next_step\n \n as \n \n next_step\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n probability\n \n as \n \n probability\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n stage_name\n \n as \n \n stage_name\n \n, \n \n \n synced_quote_id\n \n as \n \n synced_quote_id\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CampaignId\n \n , \n cast(null as timestamp) as \n \n CloseDate\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as numeric(28,6)) as \n \n ExpectedRevenue\n \n , \n cast(null as integer) as \n \n FiscalQuarter\n \n , \n cast(null as integer) as \n \n FiscalYear\n \n , \n cast(null as TEXT) as \n \n ForecastCategory\n \n , \n cast(null as TEXT) as \n \n ForecastCategoryName\n \n , \n cast(null as boolean) as \n \n HasOpenActivity\n \n , \n cast(null as boolean) as \n \n HasOpportunityLineItem\n \n , \n cast(null as boolean) as \n \n HasOverdueTask\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsWon\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n NextStep\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n StageName\n \n , \n cast(null as TEXT) as \n \n SyncedQuoteId\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_opportunity_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n cast(Amount as numeric(28,6)) as amount,\n \n\n\n\n coalesce(cast(CampaignId as TEXT),\n cast(campaign_id as TEXT))\n as campaign_id,\n \n\n\n\n coalesce(cast(CloseDate as timestamp),\n cast(close_date as timestamp))\n as close_date,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as opportunity_description,\n \n\n\n\n coalesce(cast(ExpectedRevenue as numeric(28,6)),\n cast(expected_revenue as numeric(28,6)))\n as expected_revenue,\n \n\n\n\n cast(Fiscal as TEXT) as fiscal,\n \n\n\n\n coalesce(cast(FiscalQuarter as integer),\n cast(fiscal_quarter as integer))\n as fiscal_quarter,\n \n\n\n\n coalesce(cast(FiscalYear as integer),\n cast(fiscal_year as integer))\n as fiscal_year,\n \n\n\n\n coalesce(cast(ForecastCategory as TEXT),\n cast(forecast_category as TEXT))\n as forecast_category,\n \n\n\n\n coalesce(cast(ForecastCategoryName as TEXT),\n cast(forecast_category_name as TEXT))\n as forecast_category_name,\n \n\n\n\n coalesce(cast(HasOpenActivity as boolean),\n cast(has_open_activity as boolean))\n as has_open_activity,\n \n\n\n\n coalesce(cast(HasOpportunityLineItem as boolean),\n cast(has_opportunity_line_item as boolean))\n as has_opportunity_line_item,\n \n\n\n\n coalesce(cast(HasOverdueTask as boolean),\n cast(has_overdue_task as boolean))\n as has_overdue_task,\n \n\n\n\n cast(Id as TEXT) as opportunity_id,\n \n\n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsWon as boolean),\n cast(is_won as boolean))\n as is_won,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n\n cast(Name as TEXT) as opportunity_name,\n \n\n\n\n coalesce(cast(NextStep as TEXT),\n cast(next_step as TEXT))\n as next_step,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Probability as float) as probability,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n coalesce(cast(StageName as TEXT),\n cast(stage_name as TEXT))\n as stage_name,\n \n\n\n\n coalesce(cast(SyncedQuoteId as TEXT),\n cast(synced_quote_id as TEXT))\n as synced_quote_id,\n \n\n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n), \n\ncalculated as (\n \n select \n *,\n created_date >= date_trunc('month', \n current_timestamp::timestamp\n) as is_created_this_month,\n created_date >= date_trunc('quarter', \n current_timestamp::timestamp\n) as is_created_this_quarter,\n \n ((created_date)::date - (\n current_timestamp::timestamp\n)::date)\n as days_since_created,\n \n ((created_date)::date - (close_date)::date)\n as days_to_close,\n date_trunc('month', close_date) = date_trunc('month', \n current_timestamp::timestamp\n) as is_closed_this_month,\n date_trunc('quarter', close_date) = date_trunc('quarter', \n current_timestamp::timestamp\n) as is_closed_this_quarter\n from final\n)\n\nselect * \nfrom calculated\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__user_role": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__user_role", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__user_role.sql", "original_file_path": "models/salesforce/stg_salesforce__user_role.sql", "unique_id": "model.salesforce_source.stg_salesforce__user_role", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__user_role"], "alias": "stg_salesforce__user_role", "checksum": {"name": "sha256", "checksum": "6646446e9a0329fc8f87b561455a791a2dddaade3072b49418794924a82fcee3"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a user role in your organization.", "columns": {"user_role_id": {"name": "user_role_id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "case_access_for_account_owner": {"name": "case_access_for_account_owner", "description": "The case access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_access_for_account_owner": {"name": "contact_access_for_account_owner", "description": "The contact access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_user_id": {"name": "forecast_user_id", "description": "The ID of the forecast manager associated with this role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "may_forecast_manager_share": {"name": "may_forecast_manager_share", "description": "Indicates whether the forecast manager can manually share their own forecast.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_role_name": {"name": "user_role_name", "description": "Required. Name of the role. Corresponds to Label on the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_access_for_account_owner": {"name": "opportunity_access_for_account_owner", "description": "Required. The opportunity access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.467047, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"", "raw_code": "--To disable this model, set the salesforce__user_role_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__user_role_enabled', True)) }}\n\n{% set user_role_column_list = get_user_role_columns() -%}\n{% set user_role_dict = column_list_to_dict(user_role_column_list) -%}\n\nwith fields as (\n\n select\n \n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','user_role')),\n staging_columns=user_role_column_list\n )\n }}\n\n from {{ source('salesforce','user_role') }}\n), \n\nfinal as (\n\n select\n _fivetran_deleted,\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"developer_name\", user_role_dict ) }},\n {{ salesforce_source.coalesce_rename(\"id\", user_role_dict, alias=\"user_role_id\") }},\n {{ salesforce_source.coalesce_rename(\"name\", user_role_dict, alias=\"user_role_name\") }},\n {{ salesforce_source.coalesce_rename(\"opportunity_access_for_account_owner\", user_role_dict ) }},\n {{ salesforce_source.coalesce_rename(\"parent_role_id\", user_role_dict ) }},\n {{ salesforce_source.coalesce_rename(\"rollup_description\", user_role_dict ) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__user_role_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final", "language": "sql", "refs": [], "sources": [["salesforce", "user_role"], ["salesforce", "user_role"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_user_role_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.user_role"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__user_role.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__user_role_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n developer_name\n \n as \n \n developer_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_access_for_account_owner\n \n as \n \n opportunity_access_for_account_owner\n \n, \n \n \n parent_role_id\n \n as \n \n parent_role_id\n \n, \n \n \n rollup_description\n \n as \n \n rollup_description\n \n, \n cast(null as TEXT) as \n \n DeveloperName\n \n , \n cast(null as TEXT) as \n \n OpportunityAccessForAccountOwner\n \n , \n cast(null as TEXT) as \n \n ParentRoleId\n \n , \n cast(null as TEXT) as \n \n RollupDescription\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_user_role_data\"\n), \n\nfinal as (\n\n select\n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(DeveloperName as TEXT),\n cast(developer_name as TEXT))\n as developer_name,\n \n\n\n\n cast(Id as TEXT) as user_role_id,\n \n\n\n\n cast(Name as TEXT) as user_role_name,\n \n\n\n\n coalesce(cast(OpportunityAccessForAccountOwner as TEXT),\n cast(opportunity_access_for_account_owner as TEXT))\n as opportunity_access_for_account_owner,\n \n\n\n\n coalesce(cast(ParentRoleId as TEXT),\n cast(parent_role_id as TEXT))\n as parent_role_id,\n \n\n\n\n coalesce(cast(RollupDescription as TEXT),\n cast(rollup_description as TEXT))\n as rollup_description\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, 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}, "model.salesforce_source.stg_salesforce__contact": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__contact", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__contact.sql", "original_file_path": "models/salesforce/stg_salesforce__contact.sql", "unique_id": "model.salesforce_source.stg_salesforce__contact", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__contact"], "alias": "stg_salesforce__contact", "checksum": {"name": "sha256", "checksum": "a30d335ad3c0250a5414ca775330a8ce6ce5a770dc131b1bcb530a420c8049e3"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a contact, which is a person associated with an account.", "columns": {"contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_description": {"name": "contact_description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country_code": {"name": "mailing_country_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state_code": {"name": "mailing_state_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_name": {"name": "contact_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.468092, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"", "raw_code": "{% set contact_column_list = get_contact_columns() -%}\n{% set contact_dict = column_list_to_dict(contact_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','contact')),\n staging_columns=contact_column_list\n )\n }}\n \n from {{ source('salesforce','contact') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", contact_dict, alias=\"contact_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"department\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", contact_dict, alias=\"contact_description\") }},\n {{ salesforce_source.coalesce_rename(\"email\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"first_name\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"home_phone\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"individual_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_name\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"lead_source\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_city\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_country\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_country_code\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_postal_code\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_state\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_state_code\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mailing_street\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"master_record_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"mobile_phone\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", contact_dict, alias=\"contact_name\") }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"phone\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"reports_to_id\", contact_dict) }},\n {{ salesforce_source.coalesce_rename(\"title\", contact_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__contact_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "contact"], ["salesforce", "contact"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_contact_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__contact.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n home_phone\n \n as \n \n home_phone\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n mailing_city\n \n as \n \n mailing_city\n \n, \n \n \n mailing_country\n \n as \n \n mailing_country\n \n, \n \n \n mailing_country_code\n \n as \n \n mailing_country_code\n \n, \n \n \n mailing_postal_code\n \n as \n \n mailing_postal_code\n \n, \n \n \n mailing_state\n \n as \n \n mailing_state\n \n, \n \n \n mailing_state_code\n \n as \n \n mailing_state_code\n \n, \n \n \n mailing_street\n \n as \n \n mailing_street\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n reports_to_id\n \n as \n \n reports_to_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n HomePhone\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MailingCity\n \n , \n cast(null as TEXT) as \n \n MailingCountry\n \n , \n cast(null as TEXT) as \n \n MailingCountryCode\n \n , \n cast(null as TEXT) as \n \n MailingPostalCode\n \n , \n cast(null as TEXT) as \n \n MailingState\n \n , \n cast(null as TEXT) as \n \n MailingStateCode\n \n , \n cast(null as TEXT) as \n \n MailingStreet\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ReportsToId\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_contact_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as contact_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n cast(Department as TEXT) as department,\n \n\n\n\n cast(Description as TEXT) as contact_description,\n \n\n\n\n cast(Email as TEXT) as email,\n \n\n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n\n coalesce(cast(HomePhone as TEXT),\n cast(home_phone as TEXT))\n as home_phone,\n \n\n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n\n coalesce(cast(MailingCity as TEXT),\n cast(mailing_city as TEXT))\n as mailing_city,\n \n\n\n\n coalesce(cast(MailingCountry as TEXT),\n cast(mailing_country as TEXT))\n as mailing_country,\n \n\n\n\n coalesce(cast(MailingCountryCode as TEXT),\n cast(mailing_country_code as TEXT))\n as mailing_country_code,\n \n\n\n\n coalesce(cast(MailingPostalCode as TEXT),\n cast(mailing_postal_code as TEXT))\n as mailing_postal_code,\n \n\n\n\n coalesce(cast(MailingState as TEXT),\n cast(mailing_state as TEXT))\n as mailing_state,\n \n\n\n\n coalesce(cast(MailingStateCode as TEXT),\n cast(mailing_state_code as TEXT))\n as mailing_state_code,\n \n\n\n\n coalesce(cast(MailingStreet as TEXT),\n cast(mailing_street as TEXT))\n as mailing_street,\n \n\n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n\n cast(Name as TEXT) as contact_name,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Phone as TEXT) as phone,\n \n\n\n\n coalesce(cast(ReportsToId as TEXT),\n cast(reports_to_id as TEXT))\n as reports_to_id,\n \n\n\n\n cast(Title as TEXT) as title\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__account": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__account", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__account.sql", "original_file_path": "models/salesforce/stg_salesforce__account.sql", "unique_id": "model.salesforce_source.stg_salesforce__account", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__account"], "alias": "stg_salesforce__account", "checksum": {"name": "sha256", "checksum": "8fc5b92b78f3f85d3534f826e2d53ed402cbd62966353665d443a9f4753a7d87"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).", "columns": {"account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "The ISO country code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode for the billing address. See Compound Field Considerations and Limitations for details on geolocation compound fields.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_latitude": {"name": "billing_latitude", "description": "Used with BillingLongitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_longitude": {"name": "billing_longitude", "description": "Used with BillingLatitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "The ISO state code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_company_id": {"name": "jigsaw_company_id", "description": "References the ID of a company in Data.com. If an account has a value in this field, it means that the account was imported from Data.com.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "The ISO country code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_latitude": {"name": "shipping_latitude", "description": "Used with ShippingLongitude to specify the precise geolocation of a shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "The ISO state code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic": {"name": "sic", "description": "Standard Industrial Classification code of the company\u2019s main business categorization, for example, 57340 for Electronics.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic_desc": {"name": "sic_desc", "description": "A brief description of an organization\u2019s line of business, based on its SIC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ticker_symbol": {"name": "ticker_symbol", "description": "The stock market symbol for this account. This field is available on business accounts, not person accounts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.452998, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"", "raw_code": "{% set account_column_list = get_account_columns() -%}\n{% set account_dict = column_list_to_dict(account_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','account')),\n staging_columns=account_column_list\n )\n }}\n\n from {{ source('salesforce','account') }}\n), \n\nfinal as (\n select\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"account_number\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"account_source\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"annual_revenue\", account_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"billing_city\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_country\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_postal_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_street\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", account_dict, alias=\"account_description\" ) }},\n {{ salesforce_source.coalesce_rename(\"id\", account_dict, alias=\"account_id\") }},\n {{ salesforce_source.coalesce_rename(\"industry\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"master_record_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", account_dict, alias=\"account_name\" ) }},\n {{ salesforce_source.coalesce_rename(\"number_of_employees\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"ownership\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"parent_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"rating\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_city\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_postal_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state_code\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_street\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", account_dict) }},\n {{ salesforce_source.coalesce_rename(\"website\", account_dict) }}\n\n {{ fivetran_utils.fill_pass_through_columns('salesforce__account_pass_through_columns') }}\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "account"], ["salesforce", "account"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_account_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__account.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_number\n \n as \n \n account_number\n \n, \n \n \n account_source\n \n as \n \n account_source\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n ownership\n \n as \n \n ownership\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n rating\n \n as \n \n rating\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as TEXT) as \n \n AccountNumber\n \n , \n cast(null as TEXT) as \n \n AccountSource\n \n , \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ParentId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_account_data\"\n), \n\nfinal as (\n select\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(AccountNumber as TEXT),\n cast(account_number as TEXT))\n as account_number,\n \n\n\n\n coalesce(cast(AccountSource as TEXT),\n cast(account_source as TEXT))\n as account_source,\n \n\n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n\n cast(Description as TEXT) as account_description,\n \n\n\n\n cast(Id as TEXT) as account_id,\n \n\n\n\n cast(Industry as TEXT) as industry,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n\n cast(Name as TEXT) as account_name,\n \n\n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Ownership as TEXT) as ownership,\n \n\n\n\n coalesce(cast(ParentId as TEXT),\n cast(parent_id as TEXT))\n as parent_id,\n \n\n\n\n cast(Rating as TEXT) as rating,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n\n cast(Type as TEXT) as type,\n \n\n\n\n cast(Website as TEXT) as website\n\n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__lead": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__lead", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__lead.sql", "original_file_path": "models/salesforce/stg_salesforce__lead.sql", "unique_id": "model.salesforce_source.stg_salesforce__lead", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__lead"], "alias": "stg_salesforce__lead", "checksum": {"name": "sha256", "checksum": "867419072e95b386d8e9eaa44a3ca5eb64ebc18b95268f6f530cea23d4b662cb"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a prospect or lead.", "columns": {"lead_id": {"name": "lead_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_account_id": {"name": "converted_account_id", "description": "Object reference ID that points to the account into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_contact_id": {"name": "converted_contact_id", "description": "Object reference ID that points to the contact into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_opportunity_id": {"name": "converted_opportunity_id", "description": "Object reference ID that points to the opportunity into which the lead has been converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_description": {"name": "lead_description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_date": {"name": "email_bounced_date", "description": "If bounce management is activated and an email sent to the lead bounced, the date and time of the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_reason": {"name": "email_bounced_reason", "description": "If bounce management is activated and an email sent to the lead bounced, the reason for the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "Indicates whether the lead doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this lead. This field is available if you enabled Data Protection and Privacy in Setup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_converted": {"name": "is_converted", "description": "Indicates whether the lead has been converted (true) or not (false). Label is Converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_unread_by_owner": {"name": "is_unread_by_owner", "description": "If true, lead has been assigned, but not yet viewed. See Unread Leads for more information. Label is Unread By Owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "'Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.'\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that was kept. If this record was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_name": {"name": "lead_name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees at the lead\u2019s company. Label is Employees.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the lead\u2019s owner. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "Postal code for the address of the lead. Label is Zip/Postal Code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status code for this converted lead. Status codes are defined in Status and represented in the API by the LeadStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.475818, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"", "raw_code": "--To disable this model, set the salesforce__lead_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__lead_enabled', True)) }}\n\n{% set lead_column_list = get_lead_columns() -%}\n{% set lead_dict = column_list_to_dict(lead_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','lead')),\n staging_columns=lead_column_list\n )\n }}\n \n from {{ source('salesforce','lead') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", lead_dict, alias=\"lead_id\") }},\n {{ salesforce_source.coalesce_rename(\"annual_revenue\", lead_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"city\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"company\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_account_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_contact_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"converted_opportunity_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"country\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"country_code\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", lead_dict, alias=\"lead_description\") }},\n {{ salesforce_source.coalesce_rename(\"email\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"email_bounced_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"email_bounced_reason\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"first_name\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_opted_out_of_email\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"individual_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"industry\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_converted\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_unread_by_owner\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_activity_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_name\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"lead_source\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"master_record_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"mobile_phone\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", lead_dict, alias=\"lead_name\") }},\n {{ salesforce_source.coalesce_rename(\"number_of_employees\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"phone\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"postal_code\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"state\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"state_code\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"status\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"street\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"title\", lead_dict) }},\n {{ salesforce_source.coalesce_rename(\"website\", lead_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__lead_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "lead"], ["salesforce", "lead"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_lead_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.lead"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__lead.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__lead_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company\n \n as \n \n company\n \n, \n \n \n converted_account_id\n \n as \n \n converted_account_id\n \n, \n \n \n converted_contact_id\n \n as \n \n converted_contact_id\n \n, \n \n \n converted_date\n \n as \n \n converted_date\n \n, \n \n \n converted_opportunity_id\n \n as \n \n converted_opportunity_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n email_bounced_date\n \n as \n \n email_bounced_date\n \n, \n \n \n email_bounced_reason\n \n as \n \n email_bounced_reason\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n has_opted_out_of_email\n \n as \n \n has_opted_out_of_email\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_converted\n \n as \n \n is_converted\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_unread_by_owner\n \n as \n \n is_unread_by_owner\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n ConvertedAccountId\n \n , \n cast(null as TEXT) as \n \n ConvertedContactId\n \n , \n cast(null as timestamp) as \n \n ConvertedDate\n \n , \n cast(null as TEXT) as \n \n ConvertedOpportunityId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EmailBouncedDate\n \n , \n cast(null as TEXT) as \n \n EmailBouncedReason\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as boolean) as \n \n HasOptedOutOfEmail\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsConverted\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsUnreadByOwner\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_lead_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as lead_id,\n \n\n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n\n cast(City as TEXT) as city,\n \n\n\n\n cast(Company as TEXT) as company,\n \n\n\n\n coalesce(cast(ConvertedAccountId as TEXT),\n cast(converted_account_id as TEXT))\n as converted_account_id,\n \n\n\n\n coalesce(cast(ConvertedContactId as TEXT),\n cast(converted_contact_id as TEXT))\n as converted_contact_id,\n \n\n\n\n coalesce(cast(ConvertedDate as timestamp),\n cast(converted_date as timestamp))\n as converted_date,\n \n\n\n\n coalesce(cast(ConvertedOpportunityId as TEXT),\n cast(converted_opportunity_id as TEXT))\n as converted_opportunity_id,\n \n\n\n\n cast(Country as TEXT) as country,\n \n\n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as lead_description,\n \n\n\n\n cast(Email as TEXT) as email,\n \n\n\n\n coalesce(cast(EmailBouncedDate as timestamp),\n cast(email_bounced_date as timestamp))\n as email_bounced_date,\n \n\n\n\n coalesce(cast(EmailBouncedReason as TEXT),\n cast(email_bounced_reason as TEXT))\n as email_bounced_reason,\n \n\n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n\n coalesce(cast(HasOptedOutOfEmail as boolean),\n cast(has_opted_out_of_email as boolean))\n as has_opted_out_of_email,\n \n\n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n\n cast(Industry as TEXT) as industry,\n \n\n\n\n coalesce(cast(IsConverted as boolean),\n cast(is_converted as boolean))\n as is_converted,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsUnreadByOwner as boolean),\n cast(is_unread_by_owner as boolean))\n as is_unread_by_owner,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n\n cast(Name as TEXT) as lead_name,\n \n\n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Phone as TEXT) as phone,\n \n\n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n\n cast(State as TEXT) as state,\n \n\n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n\n cast(Status as TEXT) as status,\n \n\n\n\n cast(Street as TEXT) as street,\n \n\n\n\n cast(Title as TEXT) as title,\n \n\n\n\n cast(Website as TEXT) as website\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__order": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__order", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__order.sql", "original_file_path": "models/salesforce/stg_salesforce__order.sql", "unique_id": "model.salesforce_source.stg_salesforce__order", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__order"], "alias": "stg_salesforce__order", "checksum": {"name": "sha256", "checksum": "ee9f01ed785776c82f439babc5854f6bc9aa1e12387636c6fe4d85b51aafced0"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an order associated with a contract or an account.", "columns": {"order_id": {"name": "order_id", "description": "order id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Required. ID of the Account associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_by_id": {"name": "activated_by_id", "description": "ID of the User who activated this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "City for the billing address for this order. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Country for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "ISO country code for the billing address for this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Postal code for the billing address for this order. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "State for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contract_id": {"name": "contract_id", "description": "ID of the contract associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "order_description": {"name": "order_description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "Order number assigned to this order (not the unique, system-generated ID assigned during creation). Maximum size is 30 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_order_id": {"name": "original_order_id", "description": "Optional. ID of the original order that a reduction order is reducing, if the reduction order is reducing a single order. Label is Original Order. Editable only if isReductionOrder is true. If the reduction order is reducing more than one order, leave blank. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Required. ID of the User or queue that owns this order. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Required. ID of the price book associated with this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Postal code of the shipping address. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Picklist of values that indicate order status. Each value is within one of two status categories defined in StatusCode. For example, the status picklist might contain Draft, Ready for Review, and Ready for Activation values with a StatusCode of Draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status_code": {"name": "status_code", "description": "The status category for the order. An order can be either Draft or Activated. Label is Status Category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_amount": {"name": "total_amount", "description": "The total amount for the order products associated with this order. This field is available in API v48.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "If you want to show more information about your order, you can add custom values to the Type picklist. By default, the Type field doesn't perform any actions or show any values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.479893, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__order\"", "raw_code": "--To disable this model, set the salesforce__order_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__order_enabled', True)) }}\n\n{% set order_column_list = get_order_columns() -%}\n{% set order_dict = column_list_to_dict(order_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','order')),\n staging_columns=order_column_list\n )\n }}\n \n from {{ source('salesforce','order') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", order_dict, alias=\"order_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"activated_by_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"activated_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_city\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_country\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_country_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_postal_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_state_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"billing_street\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"contract_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", order_dict, alias=\"order_description\") }},\n {{ salesforce_source.coalesce_rename(\"end_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"opportunity_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"order_number\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"original_order_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"pricebook_2_id\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_city\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_country_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_postal_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_state_code\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"shipping_street\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"status\", order_dict) }},\n {{ salesforce_source.coalesce_rename(\"total_amount\", order_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"type\", order_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__order_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "order"], ["salesforce", "order"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_order_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.order"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__order.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__order_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activated_by_id\n \n as \n \n activated_by_id\n \n, \n \n \n activated_date\n \n as \n \n activated_date\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_country_code\n \n as \n \n billing_country_code\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n contract_id\n \n as \n \n contract_id\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n original_order_id\n \n as \n \n original_order_id\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n pricebook_2_id\n \n as \n \n pricebook_2_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n total_amount\n \n as \n \n total_amount\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n ActivatedById\n \n , \n cast(null as timestamp) as \n \n ActivatedDate\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingCountryCode\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as TEXT) as \n \n ContractId\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n OrderNumber\n \n , \n cast(null as TEXT) as \n \n OriginalOrderId\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n Pricebook2Id\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n , \n cast(null as float) as \n \n TotalAmount\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_order_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as order_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n coalesce(cast(ActivatedById as TEXT),\n cast(activated_by_id as TEXT))\n as activated_by_id,\n \n\n\n\n coalesce(cast(ActivatedDate as timestamp),\n cast(activated_date as timestamp))\n as activated_date,\n \n\n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n\n coalesce(cast(BillingCountryCode as TEXT),\n cast(billing_country_code as TEXT))\n as billing_country_code,\n \n\n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n\n coalesce(cast(ContractId as TEXT),\n cast(contract_id as TEXT))\n as contract_id,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as order_description,\n \n\n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n\n coalesce(cast(OrderNumber as TEXT),\n cast(order_number as TEXT))\n as order_number,\n \n\n\n\n coalesce(cast(OriginalOrderId as TEXT),\n cast(original_order_id as TEXT))\n as original_order_id,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n coalesce(cast(Pricebook2Id as TEXT),\n cast(pricebook_2_id as TEXT))\n as pricebook_2_id,\n \n\n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n\n cast(Status as TEXT) as status,\n \n\n\n\n coalesce(cast(TotalAmount as numeric(28,6)),\n cast(total_amount as numeric(28,6)))\n as total_amount,\n \n\n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__event": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__event", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__event.sql", "original_file_path": "models/salesforce/stg_salesforce__event.sql", "unique_id": "model.salesforce_source.stg_salesforce__event", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__event"], "alias": "stg_salesforce__event", "checksum": {"name": "sha256", "checksum": "4090ea3da4f9d2f147a91f5ad3ee6ca97d212dba350b887a3e770dc295817fe5"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an event in the calendar. In the user interface, event and task records are collectively referred to as activities.", "columns": {"event_id": {"name": "event_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId.\nAccount Opportunity Contract Custom object that is a child of Account If the value of the WhatId field is any other object, and the value of the WhoId field is a contact object, then Salesforce uses that contact\u2019s AccountId. (If your org uses Shared Activities, Salesforce uses the AccountId of the primary contact.)\nOtherwise, Salesforce sets the value of the AccountId field to null.\nFor information on IDs, see ID Field Type.\nThis is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to true. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don\u2019t attempt to alter the timestamp to account for time zone differences. Label is Due Date Only. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to true.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date_time": {"name": "activity_date_time", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to false. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate. Label is Due Date Time. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to false.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "event_description": {"name": "event_description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Read-only. Available in versions 46.0 and later. This field supplies the date value that appears in the EndDateTime field. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date_time": {"name": "end_date_time", "description": "Available in versions 13.0 and later. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "event_subtype": {"name": "event_subtype", "description": "Provides standard subtypes to facilitate creating and searching for events. This field isn\u2019t updateable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_child": {"name": "is_child", "description": "Indicates whether the event is a child of another event (true) or not (false). For a child event, you can update IsReminderSet and ReminderDateTime only. You can query and delete a child event. If the objects related to the child event are different from those objects related to the parent event (this difference is possible if you use API version 25.0 or earlier) and one of the objects related to the child event is deleted, the objects related to the parent event are updated to ensure data integrity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_group_event": {"name": "is_group_event", "description": "Indicates whether the event is a group event\u2014that is, whether it has invitees (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence": {"name": "is_recurrence", "description": "Indicates whether a Salesforce Classic event is scheduled to repeat itself (true) or only occurs one time (false). This field is read-only when updating records, but not when creating them. If this field value is true, then RecurrenceEndDateOnly, RecurrenceStartDateTime, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. Label is Create recurring series of events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Contains the ID of the user or public calendar who owns the event. Label is Assigned to ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date_time": {"name": "start_date_time", "description": "Indicates the start date and time of the event. Available in versions 13.0 and later.\nIf this field has a value, then ActivityDate and ActivityDateTime must either be null or match the value of this field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available if your organization has enabled Shared Activities. Represents the count of related EventRelations pertaining to the WhatId. The count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Represents the count of related EventRelations pertaining to the WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.471961, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\"", "raw_code": "--To disable this model, set the salesforce__event_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__event_enabled', True)) }}\n\n{% set event_column_list = get_event_columns() -%}\n{% set event_dict = column_list_to_dict(event_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','event')),\n staging_columns=event_column_list\n )\n }}\n\n from {{ source('salesforce','event') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", event_dict, alias=\"event_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"activity_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"activity_date_time\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", event_dict, alias=\"event_description\") }},\n {{ salesforce_source.coalesce_rename(\"end_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"end_date_time\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"event_subtype\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"group_event_type\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_archived\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_child\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_group_event\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_recurrence\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"location\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"start_date_time\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"subject\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_count\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_id\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_count\", event_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_id\", event_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__event_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "event"], ["salesforce", "event"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_event_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.event"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__event.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__event_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n activity_date_time\n \n as \n \n activity_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n end_date_time\n \n as \n \n end_date_time\n \n, \n \n \n event_subtype\n \n as \n \n event_subtype\n \n, \n \n \n group_event_type\n \n as \n \n group_event_type\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_child\n \n as \n \n is_child\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_group_event\n \n as \n \n is_group_event\n \n, \n \n \n is_recurrence\n \n as \n \n is_recurrence\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n location\n \n as \n \n location\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n start_date_time\n \n as \n \n start_date_time\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as timestamp) as \n \n ActivityDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as timestamp) as \n \n EndDateTime\n \n , \n cast(null as TEXT) as \n \n EventSubtype\n \n , \n cast(null as TEXT) as \n \n GroupEventType\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsChild\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsGroupEvent\n \n , \n cast(null as boolean) as \n \n IsRecurrence\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as timestamp) as \n \n StartDateTime\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_event_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as event_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n\n coalesce(cast(ActivityDateTime as timestamp),\n cast(activity_date_time as timestamp))\n as activity_date_time,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as event_description,\n \n\n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n\n coalesce(cast(EndDateTime as timestamp),\n cast(end_date_time as timestamp))\n as end_date_time,\n \n\n\n\n coalesce(cast(EventSubtype as TEXT),\n cast(event_subtype as TEXT))\n as event_subtype,\n \n\n\n\n coalesce(cast(GroupEventType as TEXT),\n cast(group_event_type as TEXT))\n as group_event_type,\n \n\n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n\n coalesce(cast(IsChild as boolean),\n cast(is_child as boolean))\n as is_child,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsGroupEvent as boolean),\n cast(is_group_event as boolean))\n as is_group_event,\n \n\n\n\n coalesce(cast(IsRecurrence as boolean),\n cast(is_recurrence as boolean))\n as is_recurrence,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n cast(Location as TEXT) as location,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n coalesce(cast(StartDateTime as timestamp),\n cast(start_date_time as timestamp))\n as start_date_time,\n \n\n\n\n cast(Subject as TEXT) as subject,\n \n\n\n\n cast(Type as TEXT) as type,\n \n\n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__product_2": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__product_2", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__product_2.sql", "original_file_path": "models/salesforce/stg_salesforce__product_2.sql", "unique_id": "model.salesforce_source.stg_salesforce__product_2", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__product_2"], "alias": "stg_salesforce__product_2", "checksum": {"name": "sha256", "checksum": "68f349725a82724226dd7e9bf1df25db2d507777024610ac74f41b1fb66205c4"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a product that your company sells.", "columns": {"product_2_id": {"name": "product_2_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_description": {"name": "product_2_description", "description": "A text description of this record. Label is Product Description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_url": {"name": "display_url", "description": "URL leading to a specific version of a record in the linked external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_id": {"name": "external_id", "description": "The unique identifier of a record in the linked external data source. For example, ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "family": {"name": "family", "description": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether this record is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_name": {"name": "product_2_name", "description": "Required. Default name of this record. Label is Product Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_quantity_installments": {"name": "number_of_quantity_installments", "description": "If the product has a quantity schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_revenue_installments": {"name": "number_of_revenue_installments", "description": "If the product has a revenue schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "Default product code for this record. Your org defines the product code naming pattern.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_installment_period": {"name": "quantity_installment_period", "description": "If the product has a quantity schedule, the amount of time covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_schedule_type": {"name": "quantity_schedule_type", "description": "The type of the quantity schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit_of_measure": {"name": "quantity_unit_of_measure", "description": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_installment_period": {"name": "revenue_installment_period", "description": "If the product has a revenue schedule, the time period covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_schedule_type": {"name": "revenue_schedule_type", "description": "The type of the revenue schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stock_keeping_unit": {"name": "stock_keeping_unit", "description": "The SKU for the product. Use in tandem with or instead of the ProductCode field. For example, you can track the manufacturer\u2019s identifying code in the Product Code field and assign the product a SKU when you resell it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.48252, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"", "raw_code": "--To disable this model, set the salesforce__product_2_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__product_2_enabled', True)) }}\n\n{% set product_2_column_list = get_product_2_columns() -%}\n{% set product_2_dict = column_list_to_dict(product_2_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','product_2')),\n staging_columns=product_2_column_list\n )\n }}\n \n from {{ source('salesforce','product_2') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", product_2_dict, alias=\"product_2_id\") }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", product_2_dict, alias=\"product_2_description\") }},\n {{ salesforce_source.coalesce_rename(\"display_url\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"external_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"family\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_active\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_archived\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"name\", product_2_dict, alias=\"product_2_name\") }},\n {{ salesforce_source.coalesce_rename(\"number_of_quantity_installments\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"number_of_revenue_installments\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"product_code\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity_installment_period\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity_schedule_type\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity_unit_of_measure\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"revenue_installment_period\", product_2_dict) }},\n {{ salesforce_source.coalesce_rename(\"revenue_schedule_type\", product_2_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__product_2_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "product_2"], ["salesforce", "product_2"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_product_2_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.product_2"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__product_2.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__product_2_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n display_url\n \n as \n \n display_url\n \n, \n \n \n external_id\n \n as \n \n external_id\n \n, \n \n \n family\n \n as \n \n family\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_quantity_installments\n \n as \n \n number_of_quantity_installments\n \n, \n \n \n number_of_revenue_installments\n \n as \n \n number_of_revenue_installments\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity_installment_period\n \n as \n \n quantity_installment_period\n \n, \n \n \n quantity_schedule_type\n \n as \n \n quantity_schedule_type\n \n, \n \n \n quantity_unit_of_measure\n \n as \n \n quantity_unit_of_measure\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n revenue_installment_period\n \n as \n \n revenue_installment_period\n \n, \n \n \n revenue_schedule_type\n \n as \n \n revenue_schedule_type\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as TEXT) as \n \n DisplayUrl\n \n , \n cast(null as TEXT) as \n \n ExternalId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as integer) as \n \n NumberOfQuantityInstallments\n \n , \n cast(null as integer) as \n \n NumberOfRevenueInstallments\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as TEXT) as \n \n QuantityInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n QuantityScheduleType\n \n , \n cast(null as TEXT) as \n \n QuantityUnitOfMeasure\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n RevenueInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n RevenueScheduleType\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_product_2_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as product_2_id,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as product_2_description,\n \n\n\n\n coalesce(cast(DisplayUrl as TEXT),\n cast(display_url as TEXT))\n as display_url,\n \n\n\n\n coalesce(cast(ExternalId as TEXT),\n cast(external_id as TEXT))\n as external_id,\n \n\n\n\n cast(Family as TEXT) as family,\n \n\n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n cast(Name as TEXT) as product_2_name,\n \n\n\n\n coalesce(cast(NumberOfQuantityInstallments as integer),\n cast(number_of_quantity_installments as integer))\n as number_of_quantity_installments,\n \n\n\n\n coalesce(cast(NumberOfRevenueInstallments as integer),\n cast(number_of_revenue_installments as integer))\n as number_of_revenue_installments,\n \n\n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n\n coalesce(cast(QuantityInstallmentPeriod as TEXT),\n cast(quantity_installment_period as TEXT))\n as quantity_installment_period,\n \n\n\n\n coalesce(cast(QuantityScheduleType as TEXT),\n cast(quantity_schedule_type as TEXT))\n as quantity_schedule_type,\n \n\n\n\n coalesce(cast(QuantityUnitOfMeasure as TEXT),\n cast(quantity_unit_of_measure as TEXT))\n as quantity_unit_of_measure,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n coalesce(cast(RevenueInstallmentPeriod as TEXT),\n cast(revenue_installment_period as TEXT))\n as revenue_installment_period,\n \n\n\n\n coalesce(cast(RevenueScheduleType as TEXT),\n cast(revenue_schedule_type as TEXT))\n as revenue_schedule_type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__opportunity_line_item": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__opportunity_line_item", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__opportunity_line_item.sql", "original_file_path": "models/salesforce/stg_salesforce__opportunity_line_item.sql", "unique_id": "model.salesforce_source.stg_salesforce__opportunity_line_item", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__opportunity_line_item"], "alias": "stg_salesforce__opportunity_line_item", "checksum": {"name": "sha256", "checksum": "b40c0c11b6cbb4683706b9e9bfe23f7bb59a7607089f855239877172ab7fbd0b"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents an opportunity line item, which is a member of the list of Product2 products associated with an Opportunity.", "columns": {"opportunity_line_item_id": {"name": "opportunity_line_item_id", "description": "Line Item ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discount": {"name": "discount", "description": "Discount for the product as a percentage. When updating these records: If you specify Discount without specifying TotalPrice, the TotalPrice is adjusted to accommodate the new Discount value, and the UnitPrice is held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system knows which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_quantity_schedule": {"name": "has_quantity_schedule", "description": "Read-only. Indicates whether a quantity schedule has been created for this object (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_revenue_schedule": {"name": "has_revenue_schedule", "description": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_schedule": {"name": "has_schedule", "description": "If either HasQuantitySchedule or HasRevenueSchedule is true, this field is also true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "list_price": {"name": "list_price", "description": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_line_item_name": {"name": "opportunity_line_item_name", "description": "The opportunity line item name (known as \u201cOpportunity Product\u201d in the user interface). This read-only field is available in API version 30.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_entry_id": {"name": "pricebook_entry_id", "description": "Required. ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_id": {"name": "product_2_id", "description": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later. Use the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule. When updating these records: If you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_date": {"name": "service_date", "description": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored. Product Date\u2014ServiceDate is used if not null. Schedule Date\u2014ServiceDate is used if not null and there are no revenue schedules present for this line item, that is, there are no OpportunityLineItemSchedule records with a field Type value of Revenue that are children of this record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sort_order": {"name": "sort_order", "description": "Number indicating the sort order selected by the user. Client applications can use this to match the sort order in Salesforce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem. If you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unit_price": {"name": "unit_price", "description": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price. This field or TotalPrice is required. You can\u2019t specify both.\nIf you specify Discount and Quantity, this field or TotalPrice is required.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.477361, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"", "raw_code": "--To disable this model, set the salesforce__opportunity_line_item_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__opportunity_line_item_enabled', True)) }}\n\n{% set opportunity_line_item_column_list = get_opportunity_line_item_columns() -%}\n{% set opportunity_line_item_dict = column_list_to_dict(opportunity_line_item_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','opportunity_line_item')),\n staging_columns=opportunity_line_item_column_list\n )\n }}\n \n from {{ source('salesforce','opportunity_line_item') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", opportunity_line_item_dict, alias=\"opportunity_line_item_id\") }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", opportunity_line_item_dict, alias=\"opportunity_line_item_description\") }},\n {{ salesforce_source.coalesce_rename(\"discount\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_quantity_schedule\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_revenue_schedule\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"has_schedule\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"list_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"name\", opportunity_line_item_dict, alias=\"opportunity_line_item_name\") }},\n {{ salesforce_source.coalesce_rename(\"opportunity_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"pricebook_entry_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"product_2_id\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"product_code\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"quantity\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"service_date\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"sort_order\", opportunity_line_item_dict) }},\n {{ salesforce_source.coalesce_rename(\"total_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce_source.coalesce_rename(\"unit_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__opportunity_line_item_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "opportunity_line_item"], ["salesforce", "opportunity_line_item"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_opportunity_line_item_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__opportunity_line_item.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__opportunity_line_item_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n discount\n \n as \n \n discount\n \n, \n \n \n has_quantity_schedule\n \n as \n \n has_quantity_schedule\n \n, \n \n \n has_revenue_schedule\n \n as \n \n has_revenue_schedule\n \n, \n \n \n has_schedule\n \n as \n \n has_schedule\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n list_price\n \n as \n \n list_price\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n pricebook_entry_id\n \n as \n \n pricebook_entry_id\n \n, \n \n \n product_2_id\n \n as \n \n product_2_id\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n service_date\n \n as \n \n service_date\n \n, \n \n \n sort_order\n \n as \n \n sort_order\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n unit_price\n \n as \n \n unit_price\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n HasQuantitySchedule\n \n , \n cast(null as boolean) as \n \n HasRevenueSchedule\n \n , \n cast(null as boolean) as \n \n HasSchedule\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as float) as \n \n ListPrice\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n PricebookEntryId\n \n , \n cast(null as TEXT) as \n \n Product2Id\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as timestamp) as \n \n ServiceDate\n \n , \n cast(null as integer) as \n \n SortOrder\n \n , \n cast(null as float) as \n \n TotalPrice\n \n , \n cast(null as float) as \n \n UnitPrice\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_opportunity_line_item_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as opportunity_line_item_id,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as opportunity_line_item_description,\n \n\n\n\n cast(Discount as float) as discount,\n \n\n\n\n coalesce(cast(HasQuantitySchedule as boolean),\n cast(has_quantity_schedule as boolean))\n as has_quantity_schedule,\n \n\n\n\n coalesce(cast(HasRevenueSchedule as boolean),\n cast(has_revenue_schedule as boolean))\n as has_revenue_schedule,\n \n\n\n\n coalesce(cast(HasSchedule as boolean),\n cast(has_schedule as boolean))\n as has_schedule,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(ListPrice as numeric(28,6)),\n cast(list_price as numeric(28,6)))\n as list_price,\n \n\n\n\n cast(Name as TEXT) as opportunity_line_item_name,\n \n\n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n\n coalesce(cast(PricebookEntryId as TEXT),\n cast(pricebook_entry_id as TEXT))\n as pricebook_entry_id,\n \n\n\n\n coalesce(cast(Product2Id as TEXT),\n cast(product_2_id as TEXT))\n as product_2_id,\n \n\n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n\n cast(Quantity as float) as quantity,\n \n\n\n\n coalesce(cast(ServiceDate as timestamp),\n cast(service_date as timestamp))\n as service_date,\n \n\n\n\n coalesce(cast(SortOrder as integer),\n cast(sort_order as integer))\n as sort_order,\n \n\n\n\n coalesce(cast(TotalPrice as numeric(28,6)),\n cast(total_price as numeric(28,6)))\n as total_price,\n \n\n\n\n coalesce(cast(UnitPrice as numeric(28,6)),\n cast(unit_price as numeric(28,6)))\n as unit_price\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.salesforce_source.stg_salesforce__user": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__user", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__user.sql", "original_file_path": "models/salesforce/stg_salesforce__user.sql", "unique_id": "model.salesforce_source.stg_salesforce__user", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__user"], "alias": "stg_salesforce__user", "checksum": {"name": "sha256", "checksum": "d5b32139fbe202d94bf64b4720ed0cc1247d916dc76e4121043a950ed5c0c005"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a user in your organization.", "columns": {"user_id": {"name": "user_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the Account associated with a Customer Portal user. This field is null for Salesforce users.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "badge_text": {"name": "badge_text", "description": "The community role, displayed on the user profile page just below the user name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_center_id": {"name": "call_center_id", "description": "If Salesforce CRM Call Center is enabled, represents the call center to which this user is assigned.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "community_nickname": {"name": "community_nickname", "description": "Name used to identify this user in the Community application, which includes the ideas and answers features.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_id": {"name": "contact_id", "description": "ID of the Contact associated with this account. The contact must have a value in the AccountId field or an error occurs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "default_group_notification_frequency": {"name": "default_group_notification_frequency", "description": "The default frequency for sending the user's Chatter group email notifications when the user joins groups.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "delegated_approver_id": {"name": "delegated_approver_id", "description": "Id of the user who is a delegated approver for this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "digest_frequency": {"name": "digest_frequency", "description": "The frequency at which the system sends the user\u2019s Chatter personal email digest.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_encoding_key": {"name": "email_encoding_key", "description": "Required. The email encoding for the user, such as ISO-8859-1 or UTF-8.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_preferences_auto_bcc": {"name": "email_preferences_auto_bcc", "description": "Determines whether the user receives copies of sent emails. This option applies only if compliance BCC emails are not enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "federation_identifier": {"name": "federation_identifier", "description": "Indicates the value that must be listed in the Subject element of a Security Assertion Markup Language (SAML) IDP certificate to authenticate the user for a client application using single sign-on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_enabled": {"name": "forecast_enabled", "description": "Indicates whether the user is enabled as a forecast manager (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "The level of accuracy of a location\u2019s geographical coordinates compared with its physical address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this user. This field is available if Data Protection and Privacy is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether the user has access to log in (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_profile_photo_active": {"name": "is_profile_photo_active", "description": "Indicates whether a user has a profile photo (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language_locale_key": {"name": "language_locale_key", "description": "Required. The user\u2019s language, such as \u201cFrench\u201d or \u201cChinese (Traditional).\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_login_date": {"name": "last_login_date", "description": "The date and time when the user last successfully logged in. This value is updated if 60 seconds have elapsed since the user\u2019s last login.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "locale_sid_key": {"name": "locale_sid_key", "description": "Required. This field is a restricted picklist field. The value of the field affects formatting and parsing of values, especially numeric values, in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medium_banner_photo_url": {"name": "medium_banner_photo_url", "description": "The URL for the medium-sized user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_name": {"name": "user_name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "offline_trial_expiration_date": {"name": "offline_trial_expiration_date", "description": "The date and time when the user\u2019s Connect Offline trial expires.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_id": {"name": "profile_id", "description": "Required. ID of the user\u2019s Profile. Use this value to cache metadata based on profile. In earlier releases, this was RoleId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_admin_info_emails": {"name": "receives_admin_info_emails", "description": "Indicates whether the user receives email for administrators from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_info_emails": {"name": "receives_info_emails", "description": "Indicates whether the user receives informational email from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_email": {"name": "sender_email", "description": "The email address used as the From address when the user sends emails. This address is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_name": {"name": "sender_name", "description": "The name used as the email sender when the user sends emails. This name is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_banner_photo_url": {"name": "small_banner_photo_url", "description": "The URL for the small user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_photo_url": {"name": "small_photo_url", "description": "The URL for a thumbnail of the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "time_zone_sid_key": {"name": "time_zone_sid_key", "description": "Required. This field is a restricted picklist field. A User time zone affects the offset used when displaying or entering times in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "username": {"name": "username", "description": "Contains the name that a user enters to log in. The value for this field must be in the form of an email address, using all lowercase characters. It must also be unique across all organizations.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.4648, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"", "raw_code": "{% set user_column_list = get_user_columns() -%}\n{% set user_dict = column_list_to_dict(user_column_list) -%}\n\nwith fields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','user')),\n staging_columns=user_column_list\n )\n }}\n\n from {{ source('salesforce','user') }}\n), \n\nfinal as (\n \n select \n _fivetran_deleted,\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"account_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"alias\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"city\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"company_name\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"contact_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"country\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"country_code\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"department\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"email\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"first_name\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"id\", user_dict, alias=\"user_id\" ) }},\n {{ salesforce_source.coalesce_rename(\"individual_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"is_active\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_login_date\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_name\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_referenced_date\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"last_viewed_date\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"manager_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"name\", user_dict, alias=\"user_name\" ) }},\n {{ salesforce_source.coalesce_rename(\"postal_code\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"profile_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"state\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"state_code\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"street\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"title\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"user_role_id\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"user_type\", user_dict ) }},\n {{ salesforce_source.coalesce_rename(\"username\", user_dict ) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__user_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect * \nfrom final", "language": "sql", "refs": [], "sources": [["salesforce", "user"], ["salesforce", "user"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_user_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.user"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__user.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n alias\n \n as \n \n alias\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company_name\n \n as \n \n company_name\n \n, \n \n \n contact_id\n \n as \n \n contact_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n last_login_date\n \n as \n \n last_login_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n manager_id\n \n as \n \n manager_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n profile_id\n \n as \n \n profile_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n user_role_id\n \n as \n \n user_role_id\n \n, \n \n \n user_type\n \n as \n \n user_type\n \n, \n \n \n username\n \n as \n \n username\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CompanyName\n \n , \n cast(null as TEXT) as \n \n ContactId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as timestamp) as \n \n LastLoginDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n ManagerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n ProfileId\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n , \n cast(null as TEXT) as \n \n UserRoleId\n \n , \n cast(null as TEXT) as \n \n UserType\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_user_data\"\n), \n\nfinal as (\n \n select \n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n cast(Alias as TEXT) as alias,\n \n\n\n\n cast(City as TEXT) as city,\n \n\n\n\n coalesce(cast(CompanyName as TEXT),\n cast(company_name as TEXT))\n as company_name,\n \n\n\n\n coalesce(cast(ContactId as TEXT),\n cast(contact_id as TEXT))\n as contact_id,\n \n\n\n\n cast(Country as TEXT) as country,\n \n\n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n\n cast(Department as TEXT) as department,\n \n\n\n\n cast(Email as TEXT) as email,\n \n\n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n\n cast(Id as TEXT) as user_id,\n \n\n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n\n coalesce(cast(LastLoginDate as timestamp),\n cast(last_login_date as timestamp))\n as last_login_date,\n \n\n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(ManagerId as TEXT),\n cast(manager_id as TEXT))\n as manager_id,\n \n\n\n\n cast(Name as TEXT) as user_name,\n \n\n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n\n coalesce(cast(ProfileId as TEXT),\n cast(profile_id as TEXT))\n as profile_id,\n \n\n\n\n cast(State as TEXT) as state,\n \n\n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n\n cast(Street as TEXT) as street,\n \n\n\n\n cast(Title as TEXT) as title,\n \n\n\n\n coalesce(cast(UserRoleId as TEXT),\n cast(user_role_id as TEXT))\n as user_role_id,\n \n\n\n\n coalesce(cast(UserType as TEXT),\n cast(user_type as TEXT))\n as user_type,\n \n\n\n\n cast(Username as TEXT) as username\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, 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}, "model.salesforce_source.stg_salesforce__task": {"database": "postgres", "schema": "zz_salesforce_salesforce_dev", "name": "stg_salesforce__task", "resource_type": "model", "package_name": "salesforce_source", "path": "salesforce/stg_salesforce__task.sql", "original_file_path": "models/salesforce/stg_salesforce__task.sql", "unique_id": "model.salesforce_source.stg_salesforce__task", "fqn": ["salesforce_source", "salesforce", "stg_salesforce__task"], "alias": "stg_salesforce__task", "checksum": {"name": "sha256", "checksum": "2a4ca02e3d0a49f3789844be9bb180ee2876fd844ee887102b4df684acd9b63c"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": 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": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Represents a business activity such as making a phone call or other to-do items. In the user interface, Task and Event records are collectively referred to as activities.", "columns": {"task_id": {"name": "task_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related Account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId. Account Opportunity Contract Custom object that is a child of Account If the value of the WhatIdfield is any other object, and the value of the WhoId field is a Contact object, then Salesforce uses that contact\u2019s AccountId. (If your organization uses Shared Activities, then Salesforce uses the AccountId of the primary contact.) Otherwise, Salesforce sets the value of the AccountId field to null. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Represents the due date of the task. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. Label is Due Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_disposition": {"name": "call_disposition", "description": "Represents the result of a given call, for example, \u201cwe'll call back,\u201d or \u201ccall unsuccessful.\u201d Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_duration_in_seconds": {"name": "call_duration_in_seconds", "description": "Duration of the call in seconds. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_object": {"name": "call_object", "description": "Name of a call center. Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "completed_date_time": {"name": "completed_date_time", "description": "The date and time the task was saved with a Closed status. For insert, if the task is saved with a Closed status the field is set. If the task is saved with an Open status the field is set to NULL. For update, if the task is saved with a new Closed status, the field is reset. If the task is saved with a new non-closed status, the field is reset to NULL. If the task is saved with the same closed status (that is, unchanged) there is no change to the field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "task_description": {"name": "task_description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Indicates whether the task has been completed (true) or not (false). Is only set indirectly via the Status picklist. Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_high_priority": {"name": "is_high_priority", "description": "Indicates a high-priority task. This field is derived from the Priority field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User or Group who owns the record. Label is Assigned To ID. This field accepts Groups of type Queue only. In the user interface, Group IDs correspond with the queue\u2019s list view names. To create or update tasks assigned to Group, use v48.0 or later. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "priority": {"name": "priority", "description": "Required. Indicates the importance or urgency of a task, such as high or low.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Required. The status of the task, such as In Progress or Completed. Each predefined Status field implies a value for the IsClosed flag. To obtain picklist values, query the TaskStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the task, such as \u201cCall\u201d or \u201cSend Quote.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "task_subtype": {"name": "task_subtype", "description": "Provides standard subtypes to facilitate creating and searching for specific task subtypes.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhatId. Count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID. If Shared Activities is enabled, the value of this field is the ID of the related lead or primary contact. If you add, update, or remove the WhoId field, you might encounter problems with triggers, workflows, and data validation rules that are associated with the record. The label is Name ID. Beginning in API version 37.0, if the contact or lead ID in the WhoId field is not in the TaskWhoIds list, no error occurs and the ID is added to the TaskWhoIds as the primary WhoId. If WhoId is set to null, an arbitrary ID from the existing TaskWhoIds list is promoted to the primary position.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce_source://models/salesforce/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1721770462.484921, "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"", "raw_code": "--To disable this model, set the salesforce__task_enabled variable within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__task_enabled', True)) }}\n\n{% set task_column_list = get_task_columns() -%}\n{% set task_dict = column_list_to_dict(task_column_list) -%}\n\nwith fields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(source('salesforce','task')),\n staging_columns=task_column_list\n )\n }}\n \n from {{ source('salesforce','task') }}\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce_source.coalesce_rename(\"id\", task_dict, alias=\"task_id\") }},\n {{ salesforce_source.coalesce_rename(\"account_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"activity_date\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_disposition\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_duration_in_seconds\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_object\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"call_type\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"completed_date_time\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_by_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"created_date\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"description\", task_dict, alias=\"task_description\") }},\n {{ salesforce_source.coalesce_rename(\"is_archived\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_closed\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_deleted\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"is_high_priority\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_by_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"last_modified_date\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"owner_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"priority\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"record_type_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"status\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"subject\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"task_subtype\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"type\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_count\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"what_id\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_count\", task_dict) }},\n {{ salesforce_source.coalesce_rename(\"who_id\", task_dict) }}\n \n {{ fivetran_utils.fill_pass_through_columns('salesforce__task_pass_through_columns') }}\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "language": "sql", "refs": [], "sources": [["salesforce", "task"], ["salesforce", "task"]], "metrics": [], "depends_on": {"macros": ["macro.salesforce_source.get_task_columns", "macro.salesforce_source.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce_source.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce_source.salesforce.task"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce__task.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__task_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n call_disposition\n \n as \n \n call_disposition\n \n, \n \n \n call_duration_in_seconds\n \n as \n \n call_duration_in_seconds\n \n, \n \n \n call_object\n \n as \n \n call_object\n \n, \n \n \n call_type\n \n as \n \n call_type\n \n, \n \n \n completed_date_time\n \n as \n \n completed_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_high_priority\n \n as \n \n is_high_priority\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n priority\n \n as \n \n priority\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n task_subtype\n \n as \n \n task_subtype\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as TEXT) as \n \n CallDisposition\n \n , \n cast(null as integer) as \n \n CallDurationInSeconds\n \n , \n cast(null as TEXT) as \n \n CallObject\n \n , \n cast(null as TEXT) as \n \n CallType\n \n , \n cast(null as timestamp) as \n \n CompletedDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsHighPriority\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n TaskSubtype\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_task_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as task_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n\n coalesce(cast(CallDisposition as TEXT),\n cast(call_disposition as TEXT))\n as call_disposition,\n \n\n\n\n coalesce(cast(CallDurationInSeconds as integer),\n cast(call_duration_in_seconds as integer))\n as call_duration_in_seconds,\n \n\n\n\n coalesce(cast(CallObject as TEXT),\n cast(call_object as TEXT))\n as call_object,\n \n\n\n\n coalesce(cast(CallType as TEXT),\n cast(call_type as TEXT))\n as call_type,\n \n\n\n\n coalesce(cast(CompletedDateTime as timestamp),\n cast(completed_date_time as timestamp))\n as completed_date_time,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as task_description,\n \n\n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsHighPriority as boolean),\n cast(is_high_priority as boolean))\n as is_high_priority,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Priority as TEXT) as priority,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n cast(Status as TEXT) as status,\n \n\n\n\n cast(Subject as TEXT) as subject,\n \n\n\n\n coalesce(cast(TaskSubtype as TEXT),\n cast(task_subtype as TEXT))\n as task_subtype,\n \n\n\n\n cast(Type as TEXT) as type,\n \n\n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__account_daily_history_account_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__account_daily_history_account_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__account_daily_history_account_day_id"], "alias": "unique_salesforce__account_daily_history_account_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.312333, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__account_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__account_daily_history_account_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is not null\ngroup by account_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_day_id", "file_key_name": "models.salesforce__account_daily_history", "attached_node": "model.salesforce.salesforce__account_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_day_id", "model": "{{ get_where_subquery(ref('salesforce__account_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__account_daily_history_account_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__account_daily_history_account_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__account_daily_history_account_day_id"], "alias": "not_null_salesforce__account_daily_history_account_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.313631, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__account_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__account_daily_history_account_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_day_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_day_id", "file_key_name": "models.salesforce__account_daily_history", "attached_node": "model.salesforce.salesforce__account_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_day_id", "model": "{{ get_where_subquery(ref('salesforce__account_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__contact_daily_history_contact_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__contact_daily_history_contact_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__contact_daily_history_contact_day_id"], "alias": "unique_salesforce__contact_daily_history_contact_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.314629, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__contact_daily_history_contact_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is not null\ngroup by contact_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_day_id", "file_key_name": "models.salesforce__contact_daily_history", "attached_node": "model.salesforce.salesforce__contact_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_day_id", "model": "{{ get_where_subquery(ref('salesforce__contact_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__contact_daily_history_contact_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__contact_daily_history_contact_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__contact_daily_history_contact_day_id"], "alias": "not_null_salesforce__contact_daily_history_contact_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.315596, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__contact_daily_history_contact_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_day_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_day_id", "file_key_name": "models.salesforce__contact_daily_history", "attached_node": "model.salesforce.salesforce__contact_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "contact_day_id", "model": "{{ get_where_subquery(ref('salesforce__contact_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__opportunity_daily_history_opportunity_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__opportunity_daily_history_opportunity_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__opportunity_daily_history_opportunity_day_id"], "alias": "unique_salesforce__opportunity_daily_history_opportunity_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.317163, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__opportunity_daily_history_opportunity_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is not null\ngroup by opportunity_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_day_id", "file_key_name": "models.salesforce__opportunity_daily_history", "attached_node": "model.salesforce.salesforce__opportunity_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_day_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__opportunity_daily_history_opportunity_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__opportunity_daily_history_opportunity_day_id"], "alias": "not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f"}, "created_at": 1721770462.318198, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f\") }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_day_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_day_id", "file_key_name": "models.salesforce__opportunity_daily_history", "attached_node": "model.salesforce.salesforce__opportunity_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_day_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__manager_performance_manager_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__manager_performance_manager_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650", "fqn": ["salesforce", "salesforce", "unique_salesforce__manager_performance_manager_id"], "alias": "unique_salesforce__manager_performance_manager_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.3477728, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__manager_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__manager_performance_manager_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n manager_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is not null\ngroup by manager_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "manager_id", "file_key_name": "models.salesforce__manager_performance", "attached_node": "model.salesforce.salesforce__manager_performance", "test_metadata": {"name": "unique", "kwargs": {"column_name": "manager_id", "model": "{{ get_where_subquery(ref('salesforce__manager_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__manager_performance_manager_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__manager_performance_manager_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "fqn": ["salesforce", "salesforce", "not_null_salesforce__manager_performance_manager_id"], "alias": "not_null_salesforce__manager_performance_manager_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.34904, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__manager_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__manager_performance_manager_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect manager_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "manager_id", "file_key_name": "models.salesforce__manager_performance", "attached_node": "model.salesforce.salesforce__manager_performance", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "manager_id", "model": "{{ get_where_subquery(ref('salesforce__manager_performance')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__owner_performance_owner_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__owner_performance_owner_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7", "fqn": ["salesforce", "salesforce", "unique_salesforce__owner_performance_owner_id"], "alias": "unique_salesforce__owner_performance_owner_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.350073, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__owner_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__owner_performance_owner_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n owner_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is not null\ngroup by owner_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "owner_id", "file_key_name": "models.salesforce__owner_performance", "attached_node": "model.salesforce.salesforce__owner_performance", "test_metadata": {"name": "unique", "kwargs": {"column_name": "owner_id", "model": "{{ get_where_subquery(ref('salesforce__owner_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__owner_performance_owner_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__owner_performance_owner_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7", "fqn": ["salesforce", "salesforce", "not_null_salesforce__owner_performance_owner_id"], "alias": "not_null_salesforce__owner_performance_owner_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.3510778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__owner_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__owner_performance_owner_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect owner_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "owner_id", "file_key_name": "models.salesforce__owner_performance", "attached_node": "model.salesforce.salesforce__owner_performance", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "owner_id", "model": "{{ get_where_subquery(ref('salesforce__owner_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__opportunity_enhanced_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__opportunity_enhanced_opportunity_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc", "fqn": ["salesforce", "salesforce", "not_null_salesforce__opportunity_enhanced_opportunity_id"], "alias": "not_null_salesforce__opportunity_enhanced_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.352126, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__opportunity_enhanced_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.salesforce__opportunity_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_enhanced", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_enhanced')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__opportunity_enhanced_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__opportunity_enhanced_opportunity_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788", "fqn": ["salesforce", "salesforce", "unique_salesforce__opportunity_enhanced_opportunity_id"], "alias": "unique_salesforce__opportunity_enhanced_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.3531039, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__opportunity_enhanced_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.salesforce__opportunity_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_enhanced", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_enhanced')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__contact_enhanced_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__contact_enhanced_contact_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e", "fqn": ["salesforce", "salesforce", "unique_salesforce__contact_enhanced_contact_id"], "alias": "unique_salesforce__contact_enhanced_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.354105, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__contact_enhanced_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.salesforce__contact_enhanced", "attached_node": "model.salesforce.salesforce__contact_enhanced", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('salesforce__contact_enhanced')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__contact_enhanced_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__contact_enhanced_contact_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "fqn": ["salesforce", "salesforce", "not_null_salesforce__contact_enhanced_contact_id"], "alias": "not_null_salesforce__contact_enhanced_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.355096, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__contact_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__contact_enhanced_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.salesforce__contact_enhanced", "attached_node": "model.salesforce.salesforce__contact_enhanced", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('salesforce__contact_enhanced')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__daily_activity_date_day", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__daily_activity_date_day.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04", "fqn": ["salesforce", "salesforce", "unique_salesforce__daily_activity_date_day"], "alias": "unique_salesforce__daily_activity_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.3561401, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__daily_activity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__daily_activity_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.salesforce__daily_activity", "attached_node": "model.salesforce.salesforce__daily_activity", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('salesforce__daily_activity')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__daily_activity_date_day", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__daily_activity_date_day.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "fqn": ["salesforce", "salesforce", "not_null_salesforce__daily_activity_date_day"], "alias": "not_null_salesforce__daily_activity_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.357148, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__daily_activity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__daily_activity_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.salesforce__daily_activity", "attached_node": "model.salesforce.salesforce__daily_activity", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('salesforce__daily_activity')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32", "fqn": ["salesforce", "salesforce", "unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id"], "alias": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9"}, "created_at": 1721770462.358141, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9\") }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_line_item_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.salesforce__opportunity_line_item_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_line_item_enhanced", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_line_item_enhanced')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa", "fqn": ["salesforce", "salesforce", "not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id"], "alias": "not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12"}, "created_at": 1721770462.35912, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12\") }}", "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__opportunity_line_item_enhanced"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.salesforce__opportunity_line_item_enhanced", "attached_node": "model.salesforce.salesforce__opportunity_line_item_enhanced", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('salesforce__opportunity_line_item_enhanced')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "fqn": ["salesforce_source", "salesforce_history", "not_null_stg_salesforce__account_history_history_unique_key"], "alias": "not_null_stg_salesforce__account_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.371967, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/not_null_stg_salesforce__account_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\nwhere history_unique_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__account_history", "attached_node": "model.salesforce_source.stg_salesforce__account_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__account_history')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f", "fqn": ["salesforce_source", "salesforce_history", "unique_stg_salesforce__account_history_history_unique_key"], "alias": "unique_stg_salesforce__account_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.373068, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/unique_stg_salesforce__account_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__account_history", "attached_node": "model.salesforce_source.stg_salesforce__account_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__account_history')) }}"}, "namespace": null}}, "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end", "resource_type": "test", "package_name": "salesforce_source", "path": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6", "fqn": ["salesforce_source", "salesforce_history", "dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end"], "alias": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b"}, "created_at": 1721770462.3740742, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/dbt_utils_unique_combination_o_1ba018981642a994c5b439e57bcdab6b.sql", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n account_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\n group by account_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_salesforce__account_history", "attached_node": "model.salesforce_source.stg_salesforce__account_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["account_id", "_fivetran_start", "_fivetran_end"], "model": "{{ get_where_subquery(ref('stg_salesforce__account_history')) }}"}, "namespace": "dbt_utils"}}, "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "fqn": ["salesforce_source", "salesforce_history", "not_null_stg_salesforce__contact_history_history_unique_key"], "alias": "not_null_stg_salesforce__contact_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.387427, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/not_null_stg_salesforce__contact_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__contact_history", "attached_node": "model.salesforce_source.stg_salesforce__contact_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__contact_history')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d", "fqn": ["salesforce_source", "salesforce_history", "unique_stg_salesforce__contact_history_history_unique_key"], "alias": "unique_stg_salesforce__contact_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.388479, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/unique_stg_salesforce__contact_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__contact_history", "attached_node": "model.salesforce_source.stg_salesforce__contact_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__contact_history')) }}"}, "namespace": null}}, "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end", "resource_type": "test", "package_name": "salesforce_source", "path": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee", "fqn": ["salesforce_source", "salesforce_history", "dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end"], "alias": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2"}, "created_at": 1721770462.38977, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/dbt_utils_unique_combination_o_8338e0f8a1f58c9bf73432eac5cc75b2.sql", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n contact_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\n group by contact_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_salesforce__contact_history", "attached_node": "model.salesforce_source.stg_salesforce__contact_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["contact_id", "_fivetran_start", "_fivetran_end"], "model": "{{ get_where_subquery(ref('stg_salesforce__contact_history')) }}"}, "namespace": "dbt_utils"}}, "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "fqn": ["salesforce_source", "salesforce_history", "not_null_stg_salesforce__opportunity_history_history_unique_key"], "alias": "not_null_stg_salesforce__opportunity_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.392552, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/not_null_stg_salesforce__opportunity_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__opportunity_history", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_history')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67", "fqn": ["salesforce_source", "salesforce_history", "unique_stg_salesforce__opportunity_history_history_unique_key"], "alias": "unique_stg_salesforce__opportunity_history_history_unique_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.3940558, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/unique_stg_salesforce__opportunity_history_history_unique_key.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "history_unique_key", "file_key_name": "models.stg_salesforce__opportunity_history", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "history_unique_key", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_history')) }}"}, "namespace": null}}, "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end", "resource_type": "test", "package_name": "salesforce_source", "path": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9.sql", "original_file_path": "models/salesforce_history/stg_salesforce_history.yml", "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435", "fqn": ["salesforce_source", "salesforce_history", "dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end"], "alias": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9"}, "created_at": 1721770462.3950841, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce_history/stg_salesforce_history.yml/dbt_utils_unique_combination_o_6a5f6a74dbae2db6a4bb18ed90b8a8e9.sql", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n opportunity_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\n group by opportunity_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_salesforce__opportunity_history", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["opportunity_id", "_fivetran_start", "_fivetran_end"], "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_history')) }}"}, "namespace": "dbt_utils"}}, "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__account_account_id"], "alias": "not_null_stg_salesforce__account_account_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.485694, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__account_account_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\nwhere account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_id", "file_key_name": "models.stg_salesforce__account", "attached_node": "model.salesforce_source.stg_salesforce__account", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_salesforce__account')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__account_account_id"], "alias": "unique_stg_salesforce__account_account_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.4869492, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__account_account_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\nwhere account_id is not null\ngroup by account_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "account_id", "file_key_name": "models.stg_salesforce__account", "attached_node": "model.salesforce_source.stg_salesforce__account", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_salesforce__account')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__opportunity_opportunity_id"], "alias": "not_null_stg_salesforce__opportunity_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.4880672, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__opportunity_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.stg_salesforce__opportunity", "attached_node": "model.salesforce_source.stg_salesforce__opportunity", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__opportunity_opportunity_id"], "alias": "unique_stg_salesforce__opportunity_opportunity_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.489393, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__opportunity_opportunity_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_id", "file_key_name": "models.stg_salesforce__opportunity", "attached_node": "model.salesforce_source.stg_salesforce__opportunity", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__user_user_id"], "alias": "not_null_stg_salesforce__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.490487, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__user_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "models.stg_salesforce__user", "attached_node": "model.salesforce_source.stg_salesforce__user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__user_user_id"], "alias": "unique_stg_salesforce__user_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.491528, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__user_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_id", "file_key_name": "models.stg_salesforce__user", "attached_node": "model.salesforce_source.stg_salesforce__user", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__user_role_user_role_id"], "alias": "not_null_stg_salesforce__user_role_user_role_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.492598, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__user_role_user_role_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_role_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\nwhere user_role_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_role_id", "file_key_name": "models.stg_salesforce__user_role", "attached_node": "model.salesforce_source.stg_salesforce__user_role", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_role_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user_role')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__user_role_user_role_id"], "alias": "unique_stg_salesforce__user_role_user_role_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.493644, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__user_role_user_role_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_role_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\nwhere user_role_id is not null\ngroup by user_role_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "user_role_id", "file_key_name": "models.stg_salesforce__user_role", "attached_node": "model.salesforce_source.stg_salesforce__user_role", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_role_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user_role')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__contact_contact_id"], "alias": "not_null_stg_salesforce__contact_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.494673, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__contact_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"\nwhere contact_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.stg_salesforce__contact", "attached_node": "model.salesforce_source.stg_salesforce__contact", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('stg_salesforce__contact')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__contact_contact_id"], "alias": "unique_stg_salesforce__contact_contact_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.495669, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__contact_contact_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "contact_id", "file_key_name": "models.stg_salesforce__contact", "attached_node": "model.salesforce_source.stg_salesforce__contact", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('stg_salesforce__contact')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__event_event_id"], "alias": "not_null_stg_salesforce__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.496655, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__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_salesforce__event", "attached_node": "model.salesforce_source.stg_salesforce__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_salesforce__event')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__event_event_id"], "alias": "unique_stg_salesforce__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.497804, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n event_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\"\nwhere event_id is not null\ngroup by event_id\nhaving count(*) > 1\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_salesforce__event", "attached_node": "model.salesforce_source.stg_salesforce__event", "test_metadata": {"name": "unique", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_salesforce__event')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__lead_lead_id"], "alias": "not_null_stg_salesforce__lead_lead_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.498982, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__lead_lead_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lead_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\nwhere lead_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lead_id", "file_key_name": "models.stg_salesforce__lead", "attached_node": "model.salesforce_source.stg_salesforce__lead", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "lead_id", "model": "{{ get_where_subquery(ref('stg_salesforce__lead')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__lead_lead_id"], "alias": "unique_stg_salesforce__lead_lead_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.5000892, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__lead_lead_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n lead_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\nwhere lead_id is not null\ngroup by lead_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "lead_id", "file_key_name": "models.stg_salesforce__lead", "attached_node": "model.salesforce_source.stg_salesforce__lead", "test_metadata": {"name": "unique", "kwargs": {"column_name": "lead_id", "model": "{{ get_where_subquery(ref('stg_salesforce__lead')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id"], "alias": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b"}, "created_at": 1721770462.501119, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.stg_salesforce__opportunity_line_item", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_line_item", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_line_item')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id"], "alias": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4"}, "created_at": 1721770462.5021, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4\") }}", "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "opportunity_line_item_id", "file_key_name": "models.stg_salesforce__opportunity_line_item", "attached_node": "model.salesforce_source.stg_salesforce__opportunity_line_item", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_line_item_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity_line_item')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__order_order_id"], "alias": "not_null_stg_salesforce__order_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.503073, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__order_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__order\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_salesforce__order", "attached_node": "model.salesforce_source.stg_salesforce__order", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_salesforce__order')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__order_order_id"], "alias": "unique_stg_salesforce__order_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.504097, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__order_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__order\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_salesforce__order", "attached_node": "model.salesforce_source.stg_salesforce__order", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_salesforce__order')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__product_2_product_2_id"], "alias": "not_null_stg_salesforce__product_2_product_2_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.505445, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__product_2_product_2_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect product_2_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"\nwhere product_2_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "product_2_id", "file_key_name": "models.stg_salesforce__product_2", "attached_node": "model.salesforce_source.stg_salesforce__product_2", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "product_2_id", "model": "{{ get_where_subquery(ref('stg_salesforce__product_2')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__product_2_product_2_id"], "alias": "unique_stg_salesforce__product_2_product_2_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.506614, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__product_2_product_2_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n product_2_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"\nwhere product_2_id is not null\ngroup by product_2_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "product_2_id", "file_key_name": "models.stg_salesforce__product_2", "attached_node": "model.salesforce_source.stg_salesforce__product_2", "test_metadata": {"name": "unique", "kwargs": {"column_name": "product_2_id", "model": "{{ get_where_subquery(ref('stg_salesforce__product_2')) }}"}, "namespace": null}}, "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "not_null_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce_source", "path": "not_null_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9", "fqn": ["salesforce_source", "salesforce", "not_null_stg_salesforce__task_task_id"], "alias": "not_null_stg_salesforce__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.507705, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/not_null_stg_salesforce__task_task_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"\nwhere task_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_id", "file_key_name": "models.stg_salesforce__task", "attached_node": "model.salesforce_source.stg_salesforce__task", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_salesforce__task')) }}"}, "namespace": null}}, "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605": {"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "unique_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce_source", "path": "unique_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/stg_salesforce.yml", "unique_id": "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605", "fqn": ["salesforce_source", "salesforce", "unique_stg_salesforce__task_task_id"], "alias": "unique_stg_salesforce__task_task_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": 1721770462.508729, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce_source.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce_source/models/salesforce/stg_salesforce.yml/unique_stg_salesforce__task_task_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n task_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "task_id", "file_key_name": "models.stg_salesforce__task", "attached_node": "model.salesforce_source.stg_salesforce__task", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_salesforce__task')) }}"}, "namespace": null}}}, "sources": {"source.salesforce_source.salesforce_history.account": {"database": "postgres", "schema": "zz_salesforce", "name": "account", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce_history/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/src_salesforce_history.yml", "unique_id": "source.salesforce_source.salesforce_history.account", "fqn": ["salesforce_source", "salesforce_history", "salesforce_history", "account"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_account_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents historical records of individual accounts, which are organizations or people involved with your business (such as customers, competitors, and partners).", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_account_history_data\"", "created_at": 1721770462.539159}, "source.salesforce_source.salesforce_history.contact": {"database": "postgres", "schema": "zz_salesforce", "name": "contact", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce_history/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/src_salesforce_history.yml", "unique_id": "source.salesforce_source.salesforce_history.contact", "fqn": ["salesforce_source", "salesforce_history", "salesforce_history", "contact"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_contact_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents the historical record of contacts, which are people associated with an account.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_contact_history_data\"", "created_at": 1721770462.5399911}, "source.salesforce_source.salesforce_history.opportunity": {"database": "postgres", "schema": "zz_salesforce", "name": "opportunity", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce_history/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/src_salesforce_history.yml", "unique_id": "source.salesforce_source.salesforce_history.opportunity", "fqn": ["salesforce_source", "salesforce_history", "salesforce_history", "opportunity"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_opportunity_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents historical records of opportunities, which are sales or pending deals.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_start": {"name": "_fivetran_start", "description": "The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_end": {"name": "_fivetran_end", "description": "The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_opportunity_history_data\"", "created_at": 1721770462.540149}, "source.salesforce_source.salesforce.account": {"database": "postgres", "schema": "zz_salesforce", "name": "account", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.account", "fqn": ["salesforce_source", "salesforce", "salesforce", "account"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_account_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_number": {"name": "account_number", "description": "Account number assigned to this account (not the unique, system-generated ID assigned during creation).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_source": {"name": "account_source", "description": "The source of the account record. For example, Advertisement, Data.com, or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "The ISO country code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode for the billing address. See Compound Field Considerations and Limitations for details on geolocation compound fields.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_latitude": {"name": "billing_latitude", "description": "Used with BillingLongitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_longitude": {"name": "billing_longitude", "description": "Used with BillingLatitude to specify the precise geolocation of a billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "The ISO state code for the account\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_company_id": {"name": "jigsaw_company_id", "description": "References the ID of a company in Data.com. If an account has a value in this field, it means that the account was imported from Data.com.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this object was deleted as the result of a merge, this field contains the ID of the record that was kept. If this object was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees working at the company represented by this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "The ISO country code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_latitude": {"name": "shipping_latitude", "description": "Used with ShippingLongitude to specify the precise geolocation of a shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Details of the shipping address for this account. Postal code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "The ISO state code for the account\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic": {"name": "sic", "description": "Standard Industrial Classification code of the company\u2019s main business categorization, for example, 57340 for Electronics.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sic_desc": {"name": "sic_desc", "description": "A brief description of an organization\u2019s line of business, based on its SIC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ticker_symbol": {"name": "ticker_symbol", "description": "The stock market symbol for this account. This field is available on business accounts, not person accounts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_account_data\"", "created_at": 1721770462.540374}, "source.salesforce_source.salesforce.opportunity": {"database": "postgres", "schema": "zz_salesforce", "name": "opportunity", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.opportunity", "fqn": ["salesforce_source", "salesforce", "salesforce", "opportunity"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_opportunity_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents an opportunity, which is a sale or pending deal.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "expected_revenue": {"name": "expected_revenue", "description": "Read-only field that is equal to the product of the opportunity Amount field and the Probability.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal": {"name": "fiscal", "description": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_quarter": {"name": "fiscal_quarter", "description": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_open_activity": {"name": "has_open_activity", "description": "Indicates whether an opportunity has an open event or task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opportunity_line_item": {"name": "has_opportunity_line_item", "description": "Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_overdue_task": {"name": "has_overdue_task", "description": "Indicates whether an opportunity has an overdue task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_excluded_from_territory_2_filter": {"name": "is_excluded_from_territory_2_filter", "description": "Used for Filter-Based Opportunity Territory Assignment. Indicates whether the opportunity is excluded (True) or included (False) each time the APEX filter is executed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User who has been assigned to work this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "Pricebook2Id": {"name": "Pricebook2Id", "description": "ID of a related Pricebook2 object. The Pricebook2Id field indicates which Pricebook2 applies to this opportunity. The Pricebook2Id field is defined only for those organizations that have products enabled as a feature. You can specify values for only one field (Pricebook2Id or PricebookId)\u2014not both fields. For this reason, both fields are declared nillable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Unavailable as of version 3.0. As of version 8.0, the Pricebook object is no longer available. Use the Pricebook2Id field instead, specifying the ID of the Pricebook2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stage_name": {"name": "stage_name", "description": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "synced_quote_id": {"name": "synced_quote_id", "description": "The ID of the Quote that syncs with the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "territory_2_id": {"name": "territory_2_id", "description": "The ID of the territory that is assigned to the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_opportunity_data\"", "created_at": 1721770462.5406568}, "source.salesforce_source.salesforce.user": {"database": "postgres", "schema": "zz_salesforce", "name": "user", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.user", "fqn": ["salesforce_source", "salesforce", "salesforce", "user"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a user in your organization.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the Account associated with a Customer Portal user. This field is null for Salesforce users.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "badge_text": {"name": "badge_text", "description": "The community role, displayed on the user profile page just below the user name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_center_id": {"name": "call_center_id", "description": "If Salesforce CRM Call Center is enabled, represents the call center to which this user is assigned.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "community_nickname": {"name": "community_nickname", "description": "Name used to identify this user in the Community application, which includes the ideas and answers features.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_id": {"name": "contact_id", "description": "ID of the Contact associated with this account. The contact must have a value in the AccountId field or an error occurs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "default_group_notification_frequency": {"name": "default_group_notification_frequency", "description": "The default frequency for sending the user's Chatter group email notifications when the user joins groups.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "delegated_approver_id": {"name": "delegated_approver_id", "description": "Id of the user who is a delegated approver for this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "digest_frequency": {"name": "digest_frequency", "description": "The frequency at which the system sends the user\u2019s Chatter personal email digest.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_encoding_key": {"name": "email_encoding_key", "description": "Required. The email encoding for the user, such as ISO-8859-1 or UTF-8.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_preferences_auto_bcc": {"name": "email_preferences_auto_bcc", "description": "Determines whether the user receives copies of sent emails. This option applies only if compliance BCC emails are not enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "federation_identifier": {"name": "federation_identifier", "description": "Indicates the value that must be listed in the Subject element of a Security Assertion Markup Language (SAML) IDP certificate to authenticate the user for a client application using single sign-on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_enabled": {"name": "forecast_enabled", "description": "Indicates whether the user is enabled as a forecast manager (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "The level of accuracy of a location\u2019s geographical coordinates compared with its physical address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this user. This field is available if Data Protection and Privacy is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether the user has access to log in (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_profile_photo_active": {"name": "is_profile_photo_active", "description": "Indicates whether a user has a profile photo (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language_locale_key": {"name": "language_locale_key", "description": "Required. The user\u2019s language, such as \u201cFrench\u201d or \u201cChinese (Traditional).\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_login_date": {"name": "last_login_date", "description": "The date and time when the user last successfully logged in. This value is updated if 60 seconds have elapsed since the user\u2019s last login.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "locale_sid_key": {"name": "locale_sid_key", "description": "Required. This field is a restricted picklist field. The value of the field affects formatting and parsing of values, especially numeric values, in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medium_banner_photo_url": {"name": "medium_banner_photo_url", "description": "The URL for the medium-sized user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "offline_trial_expiration_date": {"name": "offline_trial_expiration_date", "description": "The date and time when the user\u2019s Connect Offline trial expires.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_id": {"name": "profile_id", "description": "Required. ID of the user\u2019s Profile. Use this value to cache metadata based on profile. In earlier releases, this was RoleId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_admin_info_emails": {"name": "receives_admin_info_emails", "description": "Indicates whether the user receives email for administrators from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "receives_info_emails": {"name": "receives_info_emails", "description": "Indicates whether the user receives informational email from Salesforce (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_email": {"name": "sender_email", "description": "The email address used as the From address when the user sends emails. This address is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sender_name": {"name": "sender_name", "description": "The name used as the email sender when the user sends emails. This name is the same value shown in Setup on the My Email Settings page.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_banner_photo_url": {"name": "small_banner_photo_url", "description": "The URL for the small user profile banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "small_photo_url": {"name": "small_photo_url", "description": "The URL for a thumbnail of the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "time_zone_sid_key": {"name": "time_zone_sid_key", "description": "Required. This field is a restricted picklist field. A User time zone affects the offset used when displaying or entering times in the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "username": {"name": "username", "description": "Contains the name that a user enters to log in. The value for this field must be in the form of an email address, using all lowercase characters. It must also be unique across all organizations.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_user_data\"", "created_at": 1721770462.540968}, "source.salesforce_source.salesforce.user_role": {"database": "postgres", "schema": "zz_salesforce", "name": "user_role", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.user_role", "fqn": ["salesforce_source", "salesforce", "salesforce", "user_role"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_user_role_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a user role in your organization.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "case_access_for_account_owner": {"name": "case_access_for_account_owner", "description": "The case access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contact_access_for_account_owner": {"name": "contact_access_for_account_owner", "description": "The contact access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "forecast_user_id": {"name": "forecast_user_id", "description": "The ID of the forecast manager associated with this role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "may_forecast_manager_share": {"name": "may_forecast_manager_share", "description": "Indicates whether the forecast manager can manually share their own forecast.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Name of the role. Corresponds to Label on the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_access_for_account_owner": {"name": "opportunity_access_for_account_owner", "description": "Required. The opportunity access level for the account owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_user_role_data\"", "created_at": 1721770462.541089}, "source.salesforce_source.salesforce.contact": {"database": "postgres", "schema": "zz_salesforce", "name": "contact", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.contact", "fqn": ["salesforce_source", "salesforce", "salesforce", "contact"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_contact_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a contact, which is a person associated with an account.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "assistant_name": {"name": "assistant_name", "description": "The assistant\u2019s name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "assistant_phone": {"name": "assistant_phone", "description": "The assistant\u2019s telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birthdate": {"name": "birthdate", "description": "The contact\u2019s birthdate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "do_not_call": {"name": "do_not_call", "description": "Indicates that the contact does not want to receive calls.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_date": {"name": "email_bounced_date", "description": "If bounce management is activated and an email sent to the contact bounces, the date and time of the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_reason": {"name": "email_bounced_reason", "description": "If bounce management is activated and an email sent to the contact bounces, the reason for the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The contact\u2019s fax number. Label is Business Fax.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "indicates whether the contact doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_fax": {"name": "has_opted_out_of_fax", "description": "Indicates whether the contact prohibits receiving faxes.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_email_bounced": {"name": "is_email_bounced", "description": "If bounce management is activated and an email is sent to a contact, indicates whether the email bounced (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw": {"name": "jigsaw", "description": "Data.com Key", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw contact OD", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_curequest_date": {"name": "last_curequest_date", "description": "Last Stay-in-Touch Request Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_cuupdate_date": {"name": "last_cuupdate_date", "description": "Last Stay-in-Touch Save Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_country_code": {"name": "mailing_country_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_geocode_accuracy": {"name": "mailing_geocode_accuracy", "description": "Accuracy level of the geocode for the mailing address. For details on geolocation compound field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_latitude": {"name": "mailing_latitude", "description": "Used with MailingLongitude to specify the precise geolocation of a mailing address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_longitude": {"name": "mailing_longitude", "description": "Used with MailingLatitude to specify the precise geolocation of a mailing address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_state_code": {"name": "mailing_state_code", "description": "The ISO codes for the mailing address\u2019s state and country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_city": {"name": "other_city", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_country": {"name": "other_country", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_geocode_accuracy": {"name": "other_geocode_accuracy", "description": "Accuracy level of the geocode for the other address. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_latitude": {"name": "other_latitude", "description": "Used with OtherLongitude to specify the precise geolocation of an alternate address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_longitude": {"name": "other_longitude", "description": "Used with OtherLatitude to specify the precise geolocation of an alternate address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places. For details on geolocation compound fields", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_phone": {"name": "other_phone", "description": "Telephone for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_postal_code": {"name": "other_postal_code", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_state": {"name": "other_state", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_street": {"name": "other_street", "description": "Street for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "The ID of the owner of the account associated with this contact. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "'Path to be combined with the URL of a Salesforce instance (Example: https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the contact. Generated URL returns an HTTP redirect (code 302) to the social network profile image for the contact. Empty if Social Accounts and Contacts isn't enabled or if Social Accounts and Contacts is disabled for the requesting user.'\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reports_to_id": {"name": "reports_to_id", "description": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "salutation": {"name": "salutation", "description": "Honorific abbreviation, word, or phrase to be used in front of name in greetings, such as Dr. or Mrs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_contact_data\"", "created_at": 1721770462.5413382}, "source.salesforce_source.salesforce.event": {"database": "postgres", "schema": "zz_salesforce", "name": "event", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.event", "fqn": ["salesforce_source", "salesforce", "salesforce", "event"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents an event in the calendar. In the user interface, event and task records are collectively referred to as activities.", "columns": {"id": {"name": "id", "description": "Activity ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId.\nAccount Opportunity Contract Custom object that is a child of Account If the value of the WhatId field is any other object, and the value of the WhoId field is a contact object, then Salesforce uses that contact\u2019s AccountId. (If your org uses Shared Activities, Salesforce uses the AccountId of the primary contact.)\nOtherwise, Salesforce sets the value of the AccountId field to null.\nFor information on IDs, see ID Field Type.\nThis is a relationship field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to true. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don\u2019t attempt to alter the timestamp to account for time zone differences. Label is Due Date Only. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to true.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date_time": {"name": "activity_date_time", "description": "Contains the event\u2019s due date if the IsAllDayEvent flag is set to false. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate. Label is Due Date Time. This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to false.\nThe value for this field and StartDateTime must match, or one of them must be null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Read-only. Available in versions 46.0 and later. This field supplies the date value that appears in the EndDateTime field. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date_time": {"name": "end_date_time", "description": "Available in versions 13.0 and later. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "event_subtype": {"name": "event_subtype", "description": "Provides standard subtypes to facilitate creating and searching for events. This field isn\u2019t updateable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_child": {"name": "is_child", "description": "Indicates whether the event is a child of another event (true) or not (false). For a child event, you can update IsReminderSet and ReminderDateTime only. You can query and delete a child event. If the objects related to the child event are different from those objects related to the parent event (this difference is possible if you use API version 25.0 or earlier) and one of the objects related to the child event is deleted, the objects related to the parent event are updated to ensure data integrity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_group_event": {"name": "is_group_event", "description": "Indicates whether the event is a group event\u2014that is, whether it has invitees (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Indicates whether users other than the creator of the event can (false) or can\u2019t (true) see the event details when viewing the event user\u2019s calendar. However, users with the View All Data or Modify All Data permission can see private events in reports and searches, or when viewing other users\u2019 calendars. Private events can\u2019t be associated with opportunities, accounts, cases, campaigns, contracts, leads, or contacts. Label is Private.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence": {"name": "is_recurrence", "description": "Indicates whether a Salesforce Classic event is scheduled to repeat itself (true) or only occurs one time (false). This field is read-only when updating records, but not when creating them. If this field value is true, then RecurrenceEndDateOnly, RecurrenceStartDateTime, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. Label is Create recurring series of events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence_2": {"name": "is_recurrence_2", "description": "Read-only. This field available in API version 44.0 and later. Indicates whether a Lightning Experience event is scheduled to repeat (true) or only occurs one time (false). If this field value is true, then Recurrence2PatternText and Recurrence2PatternVersion must be populated. Label is Repeat.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence_2_exception": {"name": "is_recurrence_2_exception", "description": "Read-only. This field available in API version 44.0 and later. Indicates whether an individual event in a Lightning Experience event series has a recurrence pattern that\u2019s different from the rest of the series, making it an exception.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence_2_exclusion": {"name": "is_recurrence_2_exclusion", "description": "Read-only. This field available in API version 44.0 and later. Indicates when updates to a Lightning Experience event series recurrence pattern have been made, but affect future event occurrences only. For past event occurrences, IsRecurrence2Exclusion is set to true, excluding past occurrences from the series recurrence pattern.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_reminder_set": {"name": "is_reminder_set", "description": "Indicates whether the activity is a reminder (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Contains the ID of the user or public calendar who owns the event. Label is Assigned to ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_start_date": {"name": "recurrence_2_pattern_start_date", "description": "Read-only. This field available in API version 44.0 and later. Indicates the date and time when the Lightning Experience event series begins. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_text": {"name": "recurrence_2_pattern_text", "description": "The RRULE that describes the recurrence pattern for Lightning Experience event series. Supports a subset of the RFC 5545 standard for internet calendaring and scheduling. See the Event Series section in this topic for usage examples. This field has a maximum length of 512 characters. This field is available in API version 44.0 and later, and has the Create property in API version 52.0 and later.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_time_zone": {"name": "recurrence_2_pattern_time_zone", "description": "This field available in API version 44.0 and later. Indicates the time zone in which the Lightning Experience event series was created or updated. This field uses standard Java TimeZone IDs. For example, America/Los_Angeles.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_2_pattern_version": {"name": "recurrence_2_pattern_version", "description": "Read-only. This field available in API version 44.0 and later. Indicates the standard specifications for Lightning Experience event series recurrence patterns. The only possible value is 1 (RFC 5545 v4 RRULE)\u2014RFC 5545 is a standard set of specifications for internet calendaring and scheduling that IsRecurrence2 adheres to for series recurrence patterns. RFC 5545 specifications for series recurrence patterns are called RRULES. For examples of rrule usage, see the Event Series section in this topic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_activity_id": {"name": "recurrence_activity_id", "description": "Read-only. Not required on create. Contains the ID of the main record of the Salesforce Classic recurring event. Subsequent occurrences have the same value in this field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_month": {"name": "recurrence_day_of_month", "description": "Indicates the day of the month on which the event repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_week_mask": {"name": "recurrence_day_of_week_mask", "description": "Indicates the day or days of the week on which the Salesforce Classic recurring event repeats. This field contains a bitmask. The values are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Multiple days are represented as the sum of their numerical values. For example, Tuesday and Thursday = 4 + 16 = 20.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_end_date_only": {"name": "recurrence_end_date_only", "description": "Indicates the last date on which the event repeats. For multiday Salesforce Classic recurring events, this date is the day on which the last occurrence starts. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don\u2019t attempt to alter the timestamp to account for time zone differences.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_instance": {"name": "recurrence_instance", "description": "Indicates the frequency of the Salesforce Classic event\u2019s recurrence. For example, 2nd or 3rd.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "Indicates the interval between Salesforce Classic recurring events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_month_of_year": {"name": "recurrence_month_of_year", "description": "Indicates the month in which the Salesforce Classic recurring event repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_start_date_time": {"name": "recurrence_start_date_time", "description": "Indicates the date and time when the Salesforce Classic recurring event begins. The value must precede the RecurrenceEndDateOnly. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_time_zone_sid_key": {"name": "recurrence_time_zone_sid_key", "description": "Indicates the time zone associated with a Salesforce Classic recurring event. For example, \u201cUTC-8:00\u201d for Pacific Standard Time.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_type": {"name": "recurrence_type", "description": "Indicates how often the Salesforce Classic event repeats. For example, daily, weekly, or every nth month (where \u201cnth\u201d is defined in RecurrenceInstance).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reminder_date_time": {"name": "reminder_date_time", "description": "Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. If IsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "show_as": {"name": "show_as", "description": "Indicates how this event appears when another user views the calendar: Busy, Out of Office, or Free. Label is Show Time As.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date_time": {"name": "start_date_time", "description": "Indicates the start date and time of the event. Available in versions 13.0 and later.\nIf this field has a value, then ActivityDate and ActivityDateTime must either be null or match the value of this field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available if your organization has enabled Shared Activities. Represents the count of related EventRelations pertaining to the WhatId. The count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Represents the count of related EventRelations pertaining to the WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_event_data\"", "created_at": 1721770462.541512}, "source.salesforce_source.salesforce.lead": {"database": "postgres", "schema": "zz_salesforce", "name": "lead", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.lead", "fqn": ["salesforce_source", "salesforce", "salesforce", "lead"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_lead_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a prospect or lead.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_account_id": {"name": "converted_account_id", "description": "Object reference ID that points to the account into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_contact_id": {"name": "converted_contact_id", "description": "Object reference ID that points to the contact into which the lead converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "converted_opportunity_id": {"name": "converted_opportunity_id", "description": "Object reference ID that points to the opportunity into which the lead has been converted. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_date": {"name": "email_bounced_date", "description": "If bounce management is activated and an email sent to the lead bounced, the date and time of the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email_bounced_reason": {"name": "email_bounced_reason", "description": "If bounce management is activated and an email sent to the lead bounced, the reason for the bounce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "Accuracy level of the geocode for the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "Indicates whether the lead doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "individual_id": {"name": "individual_id", "description": "ID of the data privacy record associated with this lead. This field is available if you enabled Data Protection and Privacy in Setup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_converted": {"name": "is_converted", "description": "Indicates whether the lead has been converted (true) or not (false). Label is Converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_unread_by_owner": {"name": "is_unread_by_owner", "description": "If true, lead has been assigned, but not yet viewed. See Unread Leads for more information. Label is Unread By Owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_activity_date": {"name": "last_activity_date", "description": "'Value is the most recent of either: Due date of the most recent event logged against the record. Due date of the most recently closed task associated with the record.'\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address. Acceptable values are numbers between \u201390 and 90 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address. Acceptable values are numbers between \u2013180 and 180 up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "master_record_id": {"name": "master_record_id", "description": "If this record was deleted as the result of a merge, this field contains the ID of the record that was kept. If this record was deleted for any other reason, or has not been deleted, the value is null.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_employees": {"name": "number_of_employees", "description": "Number of employees at the lead\u2019s company. Label is Employees.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the lead\u2019s owner. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "postal_code": {"name": "postal_code", "description": "Postal code for the address of the lead. Label is Zip/Postal Code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status code for this converted lead. Status codes are defined in Status and represented in the API by the LeadStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_lead_data\"", "created_at": 1721770462.541694}, "source.salesforce_source.salesforce.opportunity_line_item": {"database": "postgres", "schema": "zz_salesforce", "name": "opportunity_line_item", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.opportunity_line_item", "fqn": ["salesforce_source", "salesforce", "salesforce", "opportunity_line_item"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_opportunity_line_item_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents an opportunity line item, which is a member of the list of Product2 products associated with an Opportunity.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discount": {"name": "discount", "description": "Discount for the product as a percentage. When updating these records: If you specify Discount without specifying TotalPrice, the TotalPrice is adjusted to accommodate the new Discount value, and the UnitPrice is held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system knows which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_quantity_schedule": {"name": "has_quantity_schedule", "description": "Read-only. Indicates whether a quantity schedule has been created for this object (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_revenue_schedule": {"name": "has_revenue_schedule", "description": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "has_schedule": {"name": "has_schedule", "description": "If either HasQuantitySchedule or HasRevenueSchedule is true, this field is also true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp for when the current user last viewed a record related to this record. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed. Available in API version 50.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "list_price": {"name": "list_price", "description": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "The opportunity line item name (known as \u201cOpportunity Product\u201d in the user interface). This read-only field is available in API version 30.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_entry_id": {"name": "pricebook_entry_id", "description": "Required. ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_2_id": {"name": "product_2_id", "description": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later. Use the PricebookEntryId field instead, specifying the ID of the PricebookEntry record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule. When updating these records: If you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant. If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_date": {"name": "service_date", "description": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored. Product Date\u2014ServiceDate is used if not null. Schedule Date\u2014ServiceDate is used if not null and there are no revenue schedules present for this line item, that is, there are no OpportunityLineItemSchedule records with a field Type value of Revenue that are children of this record.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sort_order": {"name": "sort_order", "description": "Number indicating the sort order selected by the user. Client applications can use this to match the sort order in Salesforce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_price": {"name": "total_price", "description": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem. If you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "unit_price": {"name": "unit_price", "description": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price. This field or TotalPrice is required. You can\u2019t specify both.\nIf you specify Discount and Quantity, this field or TotalPrice is required.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_opportunity_line_item_data\"", "created_at": 1721770462.5418591}, "source.salesforce_source.salesforce.order": {"database": "postgres", "schema": "zz_salesforce", "name": "order", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.order", "fqn": ["salesforce_source", "salesforce", "salesforce", "order"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_order_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents an order associated with a contract or an account.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Required. ID of the Account associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_by_id": {"name": "activated_by_id", "description": "ID of the User who activated this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_city": {"name": "billing_city", "description": "City for the billing address for this order. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country": {"name": "billing_country", "description": "Country for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_country_code": {"name": "billing_country_code", "description": "ISO country code for the billing address for this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_latitude": {"name": "billing_latitude", "description": "Used with BillingLongitude to specify the precise geolocation of a billing address. Acceptable values are numbers between \u201390 and 90 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_longitude": {"name": "billing_longitude", "description": "Used with BillingLatitude to specify the precise geolocation of a billing address. Acceptable values are numbers between \u2013180 and 180 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Postal code for the billing address for this order. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state": {"name": "billing_state", "description": "State for the billing address for this order. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company_authorized_by_id": {"name": "company_authorized_by_id", "description": "ID of the user who authorized the account associated with the order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contract_id": {"name": "contract_id", "description": "ID of the contract associated with this order. Can only be updated when the order\u2019s StatusCode value is Draft. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "customer_authorized_by_id": {"name": "customer_authorized_by_id", "description": "ID of the contact who authorized the order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "effective_date": {"name": "effective_date", "description": "Date at which the order becomes effective. Label is Order Start Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_reduction_order": {"name": "is_reduction_order", "description": "Read-only. Determines whether an order is a reduction order. Label is Reduction Order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "order_number": {"name": "order_number", "description": "Order number assigned to this order (not the unique, system-generated ID assigned during creation). Maximum size is 30 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_order_id": {"name": "original_order_id", "description": "Optional. ID of the original order that a reduction order is reducing, if the reduction order is reducing a single order. Label is Original Order. Editable only if isReductionOrder is true. If the reduction order is reducing more than one order, leave blank. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "Required. ID of the User or queue that owns this order. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pricebook_2_id": {"name": "pricebook_2_id", "description": "Required. ID of the price book associated with this order. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_latitude": {"name": "shipping_latitude", "description": "Used with ShippingLongitude to specify the precise geolocation of a shipping address. Acceptable values are numbers between \u201390 and 90 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address. Acceptable values are numbers between \u2013180 and 180 with up to 15 decimal places.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_postal_code": {"name": "shipping_postal_code", "description": "Postal code of the shipping address. Maximum size is 20 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Picklist of values that indicate order status. Each value is within one of two status categories defined in StatusCode. For example, the status picklist might contain Draft, Ready for Review, and Ready for Activation values with a StatusCode of Draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status_code": {"name": "status_code", "description": "The status category for the order. An order can be either Draft or Activated. Label is Status Category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_amount": {"name": "total_amount", "description": "The total amount for the order products associated with this order. This field is available in API v48.0 and later.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "If you want to show more information about your order, you can add custom values to the Type picklist. By default, the Type field doesn't perform any actions or show any values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_order_data\"", "created_at": 1721770462.5420318}, "source.salesforce_source.salesforce.product_2": {"database": "postgres", "schema": "zz_salesforce", "name": "product_2", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.product_2", "fqn": ["salesforce_source", "salesforce", "salesforce", "product_2"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_product_2_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a product that your company sells.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "A text description of this record. Label is Product Description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_url": {"name": "display_url", "description": "URL leading to a specific version of a record in the linked external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_id": {"name": "external_id", "description": "The unique identifier of a record in the linked external data source. For example, ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "family": {"name": "family", "description": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_active": {"name": "is_active", "description": "Indicates whether this record is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_referenced_date": {"name": "last_referenced_date", "description": "The timestamp when the current user last accessed this record, a record related to this record, or a list view.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_viewed_date": {"name": "last_viewed_date", "description": "The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Required. Default name of this record. Label is Product Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_quantity_installments": {"name": "number_of_quantity_installments", "description": "If the product has a quantity schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "number_of_revenue_installments": {"name": "number_of_revenue_installments", "description": "If the product has a revenue schedule, the number of installments.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "product_code": {"name": "product_code", "description": "Default product code for this record. Your org defines the product code naming pattern.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_installment_period": {"name": "quantity_installment_period", "description": "If the product has a quantity schedule, the amount of time covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_schedule_type": {"name": "quantity_schedule_type", "description": "The type of the quantity schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit_of_measure": {"name": "quantity_unit_of_measure", "description": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_installment_period": {"name": "revenue_installment_period", "description": "If the product has a revenue schedule, the time period covered by the schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_schedule_type": {"name": "revenue_schedule_type", "description": "The type of the revenue schedule, if the product has one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stock_keeping_unit": {"name": "stock_keeping_unit", "description": "The SKU for the product. Use in tandem with or instead of the ProductCode field. For example, you can track the manufacturer\u2019s identifying code in the Product Code field and assign the product a SKU when you resell it.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_product_2_data\"", "created_at": 1721770462.542172}, "source.salesforce_source.salesforce.task": {"database": "postgres", "schema": "zz_salesforce", "name": "task", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.task", "fqn": ["salesforce_source", "salesforce", "salesforce", "task"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_task_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Represents a business activity such as making a phone call or other to-do items. In the user interface, Task and Event records are collectively referred to as activities.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_active": {"name": "_fivetran_active", "description": "True if record is active, used to filter out only active records if History Mode is enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "account_id": {"name": "account_id", "description": "Represents the ID of the related Account. The AccountId is determined as follows. If the value of WhatId is any of the following objects, then Salesforce uses that object\u2019s AccountId. Account Opportunity Contract Custom object that is a child of Account If the value of the WhatIdfield is any other object, and the value of the WhoId field is a Contact object, then Salesforce uses that contact\u2019s AccountId. (If your organization uses Shared Activities, then Salesforce uses the AccountId of the primary contact.) Otherwise, Salesforce sets the value of the AccountId field to null. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "activity_date": {"name": "activity_date", "description": "Represents the due date of the task. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. Label is Due Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_disposition": {"name": "call_disposition", "description": "Represents the result of a given call, for example, \u201cwe'll call back,\u201d or \u201ccall unsuccessful.\u201d Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_duration_in_seconds": {"name": "call_duration_in_seconds", "description": "Duration of the call in seconds. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_object": {"name": "call_object", "description": "Name of a call center. Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "completed_date_time": {"name": "completed_date_time", "description": "The date and time the task was saved with a Closed status. For insert, if the task is saved with a Closed status the field is set. If the task is saved with an Open status the field is set to NULL. For update, if the task is saved with a new Closed status, the field is reset. If the task is saved with a new non-closed status, the field is reset to NULL. If the task is saved with the same closed status (that is, unchanged) there is no change to the field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Indicates whether the task has been completed (true) or not (false). Is only set indirectly via the Status picklist. Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_high_priority": {"name": "is_high_priority", "description": "Indicates a high-priority task. This field is derived from the Priority field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_recurrence": {"name": "is_recurrence", "description": "Indicates whether the task is scheduled to repeat itself (true) or only occurs once (false). This field is read-only on update, but not on create. If this field value is true, then RecurrenceStartDateOnly, RecurrenceEndDateOnly, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. See Recurring Tasks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_reminder_set": {"name": "is_reminder_set", "description": "Indicates whether a popup reminder has been set for the task (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "owner_id": {"name": "owner_id", "description": "ID of the User or Group who owns the record. Label is Assigned To ID. This field accepts Groups of type Queue only. In the user interface, Group IDs correspond with the queue\u2019s list view names. To create or update tasks assigned to Group, use v48.0 or later. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "priority": {"name": "priority", "description": "Required. Indicates the importance or urgency of a task, such as high or low.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_activity_id": {"name": "recurrence_activity_id", "description": "Read-only. Not required on create. ID of the main record of the recurring task. Subsequent occurrences have the same value in this field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_month": {"name": "recurrence_day_of_month", "description": "The day of the month in which the task repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_day_of_week_mask": {"name": "recurrence_day_of_week_mask", "description": "The day or days of the week on which the task repeats. This field contains a bitmask. The values are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Multiple days are represented as the sum of their numerical values. For example, Tuesday and Thursday = 4 + 16 = 20.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_end_date_only": {"name": "recurrence_end_date_only", "description": "The last date on which the task repeats. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. ", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_instance": {"name": "recurrence_instance", "description": "The frequency of the recurring task. Possible values are: First\u20141st Fourth\u20144th Last\u2014last Second\u20142nd Third\u20143rd", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "The interval between recurring tasks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_month_of_year": {"name": "recurrence_month_of_year", "description": "The month of the year in which the task repeats.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_regenerated_type": {"name": "recurrence_regenerated_type", "description": "Represents what triggers a repeating task to repeat. Add this field to a page layout together with the RecurrenceInterval field, which determines the number of days between the triggering date (due date or close date) and the due date of the next repeating task in the series. Label is Repeat This Task. This field has the following picklist values: None: The task doesn\u2019t repeat. After due date: The next repeating task will be due the specified number of days after the current task\u2019s due date. After the task is closed: The next repeating task will be due the specified number of days after the current task is closed. (Task closed): This task, now closed, was opened as part of a repeating series. ", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_start_date_only": {"name": "recurrence_start_date_only", "description": "The date when the recurring task begins. Must be a date and time before RecurrenceEndDateOnly.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_time_zone_sid_key": {"name": "recurrence_time_zone_sid_key", "description": "The time zone associated with the recurring task. For example, \u201cUTC-8:00\u201d for Pacific Standard Time.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recurrence_type": {"name": "recurrence_type", "description": "Indicates how often the task repeats. For example, daily, weekly, or every nth month (where \u201cnth\u201d is defined in RecurrenceInstance).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reminder_date_time": {"name": "reminder_date_time", "description": "Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. If IsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Required. The status of the task, such as In Progress or Completed. Each predefined Status field implies a value for the IsClosed flag. To obtain picklist values, query the TaskStatus object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subject": {"name": "subject", "description": "The subject line of the task, such as \u201cCall\u201d or \u201cSend Quote.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "task_subtype": {"name": "task_subtype", "description": "Provides standard subtypes to facilitate creating and searching for specific task subtypes.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_count": {"name": "what_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhatId. Count of the WhatId must be 1 or less.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "what_id": {"name": "what_id", "description": "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object. The label is Related To ID. This is a polymorphic relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_count": {"name": "who_count", "description": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhoId.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "who_id": {"name": "who_id", "description": "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact\u2019s ID or a lead\u2019s ID. The label is Name ID. If Shared Activities is enabled, the value of this field is the ID of the related lead or primary contact. If you add, update, or remove the WhoId field, you might encounter problems with triggers, workflows, and data validation rules that are associated with the record. The label is Name ID. Beginning in API version 37.0, if the contact or lead ID in the WhoId field is not in the TaskWhoIds list, no error occurs and the ID is added to the TaskWhoIds as the primary WhoId. If WhoId is set to null, an arbitrary ID from the existing TaskWhoIds list is promoted to the primary position.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"sf_task_data\"", "created_at": 1721770462.5423281}, "source.salesforce_source.salesforce.fivetran_formula": {"database": "postgres", "schema": "zz_salesforce", "name": "fivetran_formula", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.fivetran_formula", "fqn": ["salesforce_source", "salesforce", "salesforce", "fivetran_formula"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "fivetran_formula", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Holds the formula fields for each of your custom fields", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"fivetran_formula\"", "created_at": 1721770462.542419}, "source.salesforce_source.salesforce.fivetran_formula_model": {"database": "postgres", "schema": "zz_salesforce", "name": "fivetran_formula_model", "resource_type": "source", "package_name": "salesforce_source", "path": "models/salesforce/src_salesforce.yml", "original_file_path": "models/salesforce/src_salesforce.yml", "unique_id": "source.salesforce_source.salesforce.fivetran_formula_model", "fqn": ["salesforce_source", "salesforce", "salesforce", "fivetran_formula_model"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "fivetran_formula_model", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Holds the formula fields for each of your salesforce objects as a single select statement", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"zz_salesforce\".\"fivetran_formula_model\"", "created_at": 1721770462.542509}}, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.588907, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.589152, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.589264, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.589375, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.5894852, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.5914571, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.591868, "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 with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v', 'm')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_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}, "patch_path": null, "arguments": [], "created_at": 1721770460.592671, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.592833, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.602706, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6032388, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.603572, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.603914, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.604446, "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 {% 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.605099, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6052961, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.605758, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.606184, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.607007, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.607199, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6075141, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.607779, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6081889, "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 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6084101, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6089869, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.609188, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6093068, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.609482, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.609619, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.609997, "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 update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.610929, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.611181, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.611542, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.611735, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.611933, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.612938, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.613451, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.613736, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.614161, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6142972, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.614965, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6151419, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6152802, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.615834, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6160069, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.616218, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.616816, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6199858, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6201391, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.620785, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6212852, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.62241, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.622616, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6228192, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.622989, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.623158, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.623573, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6238961, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.624255, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.624732, "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 merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.625012, "supported_languages": null}, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6286662, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.628832, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.629046, "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, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\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 }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\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 }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.629725, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.629886, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.630047, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.631593, "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, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', 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_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\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 }) %}\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.633014, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.637312, "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 }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.6375911, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.637752, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.637843, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.637995, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.638119, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.638321, "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\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_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\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.639337, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.639528, "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\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.639772, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.640181, "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 {%- set config = model['config'] -%}\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 {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", 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 final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\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 missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\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', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\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 {% 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.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.646956, "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\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 {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\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 %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\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 {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["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}, "patch_path": null, "arguments": [], "created_at": 1721770460.649785, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.651146, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.651467, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6516821, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6523678, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.652786, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.653148, "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\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 {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.654848, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6597602, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6601422, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6603808, "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 ~ \"`\") }}\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 ~ \"`\") }}\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6619442, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.662244, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.66296, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6659331, "supported_languages": ["sql"]}, "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 -- 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 {% do create_indexes(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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6687129, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.670291, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.670961, "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\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.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.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}, "patch_path": null, "arguments": [], "created_at": 1721770460.67182, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.672191, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.672961, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6793458, "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 unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.681217, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.68154, "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 sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6824949, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6827562, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.683369, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.683966, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6848278, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.685052, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6852312, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6855109, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6856902, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6859741, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.686154, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.686404, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.686582, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.6867268, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.68699, "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 {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\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_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\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 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 {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\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.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.691982, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.697948, "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\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.69913, "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\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\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 {%- 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 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7002728, "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\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.70134, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.701652, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.701787, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.702106, "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 }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.702257, "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\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 ~ \" 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 {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\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 {% 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.706058, "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)) }}\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 = load_csv_rows(model, agate_table) %}\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7092109, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.714721, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.715689, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7159302, "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 %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.716413, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.716608, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.716747, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.716893, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.717061, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.717251, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.717383, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7178812, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7180648, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.719357, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.719831, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.720233, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.720845, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.721112, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.721401, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.721823, "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 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.722075, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7227762, "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 }} 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.723126, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.723305, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.723499, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.723688, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.724446, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.725688, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.726194, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.726474, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.726751, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.726961, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.72727, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.727478, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.728168, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.728589, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.728792, "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 }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.7290628, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.729404, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7296581, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.730123, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.730552, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.73087, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.73107, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.731311, "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 }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.731414, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7316859, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7318988, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.732191, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.732327, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.732588, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7327318, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.733323, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7335, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7337751, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.733912, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.734177, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.734316, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7353, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.735418, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7360158, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.736307, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.736467, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7379892, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7384021, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.738862, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7391639, "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 }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.739285, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7395608, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.739707, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7399812, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.740125, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7409549, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.741148, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.741573, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.742233, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.742678, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.742856, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.743027, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.743268, "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 }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.743371, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.74421, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.744349, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.745486, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.745677, "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 ~ \" 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.745885, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.746332, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.746492, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.746895, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.747055, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.747226, "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 }}\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7476301, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7479732, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.748256, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7484941, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7490351, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7504199, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7509692, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.751244, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.753047, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7542322, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7549272, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.755147, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7553651, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.755442, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.756352, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.757094, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.757349, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.757744, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.758104, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.758404, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7587311, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.758903, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.759222, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.759371, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7602391, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7606668, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.760854, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.761375, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.761638, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.761745, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.762122, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.762401, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.762634, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7627132, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7629728, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.763124, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7634282, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.763566, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7641852, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.76459, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.764919, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.765078, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7653508, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7654872, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.765735, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.765892, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.766133, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.766294, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.766557, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.766686, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.766922, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.767339, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.767751, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7679172, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7681642, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.768265, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.769183, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.769326, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.76949, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.76964, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7697952, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.769946, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.770103, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.770278, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.770437, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7705832, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.770737, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.7708778, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.771038, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.77119, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.771463, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.800246, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8005571, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.80067, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.801012, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8012722, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.801418, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.801939, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.802098, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.802312, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.802578, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8027031, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8030589, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.803293, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8035688, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8037, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.804064, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.804302, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.804458, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.804634, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.805106, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8052568, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.805404, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.805506, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.805665, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8057432, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.805904, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.806062, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8068779, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8070111, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.807162, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8075452, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.807866, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.808055, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.80823, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.808361, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.810393, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.810773, "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 {{ 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.811035, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8113868, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.811657, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.811998, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.812187, "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 }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.812348, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.812595, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8131359, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8133602, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.813501, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.813926, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.81432, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.814703, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.815135, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.817054, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.817218, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8174121, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.817546, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8180969, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.818312, "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 }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.8184278, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8186638, "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 }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.818866, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8191009, "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 revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.819359, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.819607, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.820266, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.820446, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.820689, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.820908, "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 ~': 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8219929, "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 -%}\n {{ sql_header }}\n {%- endif -%}\n {%- if limit is not none -%}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n {%- else -%}\n {{ compiled_code }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.82253, "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": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.822714, "supported_languages": null}, "macro.dbt.default__get_limit_subquery_sql": {"name": "default__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.default__get_limit_subquery_sql", "macro_sql": "{% macro default__get_limit_subquery_sql(sql, limit) %}\n select *\n from (\n {{ sql }}\n ) as model_limit_subq\n limit {{ limit }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.822846, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8235662, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.823732, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.823928, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.824089, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.824449, "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 {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.824908, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.827899, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.828289, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.828543, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8288279, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.829036, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.829219, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.82942, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.829694, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.829907, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8302221, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.83049, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.830712, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.830888, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8310342, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.831233, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8314009, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.837373, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.837574, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.838063, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.838277, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.838485, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8386712, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.839799, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.840286, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.840564, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.840946, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.841204, "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 }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.841846, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.84219, "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 }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.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.name }}{{ ',' 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.842963, "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{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\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\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 }}{% 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 }}{% 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.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.8461802, "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) %}\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 }}{% 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.846715, "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 {#-- 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 -%}", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.8477938, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.849456, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.849608, "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 {%- 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8506072, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8511, "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 -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.8516932, "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\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.852179, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.852261, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.852858, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.853118, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.853502, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.853847, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.854225, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8547258, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.855276, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.856092, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.85647, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.856813, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.857911, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.85904, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.859951, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8610072, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8616698, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.862002, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.862705, "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 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\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.8634958, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.863936, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.864377, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.865074, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8655722, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.866144, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.86654, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8671958, "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 where {{ column_name }} is not null\n limit 1\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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8680232, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.868648, "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 {% set column_list = 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8693602, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.869934, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8702872, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8706791, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.871107, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.871818, "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 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": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.872779, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.873708, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.874579, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.876726, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.880748, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8815382, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.881856, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.885638, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.887255, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8875499, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8877199, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.888164, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.888443, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.888635, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.888882, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8890638, "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{#- 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.889725, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.890572, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.891284, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8920388, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.892291, "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 1) - 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.892639, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.893033, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8936489, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.893954, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.89428, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.895044, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.896116, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.8970299, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.897454, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.897731, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.898377, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.899072, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.899885, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.900277, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.900548, "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) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.901779, "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) -%}\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 {%- 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 }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.90321, "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') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.904542, "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') -%}\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 select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.906389, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.906681, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.906813, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.910027, "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) }} 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 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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9135082, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.913803, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.91404, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.914913, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9152188, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.915452, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.915675, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9158678, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.91605, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.91624, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.916687, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.916945, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9173162, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.917904, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.918248, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.918591, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9221718, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.922611, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9233851, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9240708, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9245481, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9259222, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9277928, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.928885, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.929695, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.930161, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.930856, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9316218, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.932062, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.932246, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.932617, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.933179, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.933625, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9342232, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9347498, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.934886, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9350212, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.935154, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.935881, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.936788, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.937946, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.938254, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9388201, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.939682, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.944886, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.945802, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.946759, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.947505, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.948201, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.9491708, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.949379, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.949499, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.952416, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.960172, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.960321, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.9603992, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.960952, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\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=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\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"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.962492, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.96281, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.9630752, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.9633338, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.96365, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.963841, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.964035, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.964405, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.965343, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.965632, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.965864, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.966041, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.966198, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9663842, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.967375, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.968011, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.969345, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9695842, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.969822, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.970051, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.970277, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9705331, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.970782, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.97101, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.971321, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.971427, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.971526, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9716249, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.971974, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9726532, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.973652, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.974199, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.974942, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.975401, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.975657, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.975845, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9759948, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.976151, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.979291, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.979455, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.979615, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.979765, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9814558, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9823942, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.982526, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.982786, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.983063, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.983189, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.983308, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.983427, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9835489, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.984024, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.984561, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.985044, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.985239, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.985455, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.985858, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.987104, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9909198, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.991263, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.991615, "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\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.993147, "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 %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770460.993668, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.994228, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.994379, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9945269, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.994694, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9948401, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.994984, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.996076, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.997408, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9982631, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9984472, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9986188, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.998788, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9989529, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9991271, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.9993799, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.999489, "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}, "patch_path": null, "arguments": [], "created_at": 1721770460.999583, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0002, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0016158, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.001798, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.002686, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.006497, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.011274, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.012706, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0130591, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.013212, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0134132, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0137641, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0138812, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0140119, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.014115, "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 -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.014219, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.014476, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0145879, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.014688, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.015147, "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}, "patch_path": null, "arguments": [], "created_at": 1721770461.0155468, "supported_languages": null}, "macro.salesforce.custom_persist_pass_through_columns": {"name": "custom_persist_pass_through_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/custom_persist_pass_through_columns.sql", "original_file_path": "macros/custom_persist_pass_through_columns.sql", "unique_id": "macro.salesforce.custom_persist_pass_through_columns", "macro_sql": "{% macro custom_persist_pass_through_columns(pass_through_variable, identifier=none, transform='', append_string='') %}\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 }}{{ append_string }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.016417, "supported_languages": null}, "macro.salesforce_source.get_contact_columns": {"name": "get_contact_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_contact_columns.sql", "original_file_path": "macros/get_contact_columns.sql", "unique_id": "macro.salesforce_source.get_contact_columns", "macro_sql": "{% macro get_contact_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"department\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"home_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"individual_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"lead_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"mailing_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"master_record_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"reports_to_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__contact_pass_through_columns')) }} \n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.020255, "supported_languages": null}, "macro.salesforce_source.get_account_columns": {"name": "get_account_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_account_columns.sql", "original_file_path": "macros/get_account_columns.sql", "unique_id": "macro.salesforce_source.get_account_columns", "macro_sql": "{% macro get_account_columns() %}\n\n{% set columns = [\n\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"account_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt.type_float()},\n {\"name\": \"billing_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"master_record_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_employees\", \"datatype\": dbt.type_int()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ownership\", \"datatype\": dbt.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"rating\", \"datatype\": dbt.type_string()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"website\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__account_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.02412, "supported_languages": null}, "macro.salesforce_source.coalesce_rename": {"name": "coalesce_rename", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/coalesce_rename.sql", "original_file_path": "macros/coalesce_rename.sql", "unique_id": "macro.salesforce_source.coalesce_rename", "macro_sql": "{% macro coalesce_rename(\n column_key,\n column_dict,\n original_column_name=column_dict[column_key][\"name\"],\n datatype=column_dict[column_key][\"datatype\"],\n alias=column_dict[column_key][\"alias\"] | default(original_column_name),\n renamed_column_name=column_dict[column_key][\"renamed_column_name\"]\n ) %}\n\n{# This macro accomodates Fivetran connectors that keep the original salesforce field naming conventions without underscores #}\n{# Utilizes the dictionary generated by `column_list_to_dict` to coalesce a column with its renamed counterpart, producing the final column. This macro also allows for the passing of a custom renamed spelling, datatype, and alias as arguments to override default values. #}\n{%- if original_column_name|lower == renamed_column_name|lower %}\n cast({{ renamed_column_name }} as {{ datatype }}) as {{ alias }}\n\n{%- else %}\n coalesce(cast({{ renamed_column_name }} as {{ datatype }}),\n cast({{ original_column_name }} as {{ datatype }}))\n as {{ alias }}\n\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.024898, "supported_languages": null}, "macro.salesforce_source.get_task_columns": {"name": "get_task_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_task_columns.sql", "original_file_path": "macros/get_task_columns.sql", "unique_id": "macro.salesforce_source.get_task_columns", "macro_sql": "{% macro get_task_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"call_disposition\", \"datatype\": dbt.type_string()},\n {\"name\": \"call_duration_in_seconds\", \"datatype\": dbt.type_int()},\n {\"name\": \"call_object\", \"datatype\": dbt.type_string()},\n {\"name\": \"call_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"completed_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"is_closed\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_high_priority\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"priority\", \"datatype\": dbt.type_string()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"task_subtype\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"what_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"what_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"who_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"who_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__task_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.0282161, "supported_languages": null}, "macro.salesforce_source.get_user_role_columns": {"name": "get_user_role_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_user_role_columns.sql", "original_file_path": "macros/get_user_role_columns.sql", "unique_id": "macro.salesforce_source.get_user_role_columns", "macro_sql": "{% macro get_user_role_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"developer_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"opportunity_access_for_account_owner\", \"datatype\": dbt.type_string()},\n {\"name\": \"parent_role_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"rollup_description\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__user_role_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_boolean", "macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.029386, "supported_languages": null}, "macro.salesforce_source.get_order_columns": {"name": "get_order_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_order_columns.sql", "original_file_path": "macros/get_order_columns.sql", "unique_id": "macro.salesforce_source.get_order_columns", "macro_sql": "{% macro get_order_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activated_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activated_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"billing_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"billing_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"contract_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"end_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"opportunity_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"order_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"original_order_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"pricebook_2_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_city\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"shipping_street\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"total_amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__order_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_float", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.033603, "supported_languages": null}, "macro.salesforce_source.get_user_columns": {"name": "get_user_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_user_columns.sql", "original_file_path": "macros/get_user_columns.sql", "unique_id": "macro.salesforce_source.get_user_columns", "macro_sql": "{% macro get_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"alias\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"company_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"department\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"individual_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_active\", \"datatype\": \"boolean\"},\n {\"name\": \"last_login_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"manager_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"profile_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"street\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_role_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"username\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__user_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_boolean", "macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.037339, "supported_languages": null}, "macro.salesforce_source.get_product_2_columns": {"name": "get_product_2_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_product_2_columns.sql", "original_file_path": "macros/get_product_2_columns.sql", "unique_id": "macro.salesforce_source.get_product_2_columns", "macro_sql": "{% macro get_product_2_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"display_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"external_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"family\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_active\", \"datatype\": \"boolean\"},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_quantity_installments\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_revenue_installments\", \"datatype\": dbt.type_int()},\n {\"name\": \"product_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity_installment_period\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity_schedule_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity_unit_of_measure\", \"datatype\": dbt.type_string()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"revenue_installment_period\", \"datatype\": dbt.type_string()},\n {\"name\": \"revenue_schedule_type\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__product_2_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.0402958, "supported_languages": null}, "macro.salesforce_source.column_list_to_dict": {"name": "column_list_to_dict", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/column_list_to_dict.sql", "original_file_path": "macros/column_list_to_dict.sql", "unique_id": "macro.salesforce_source.column_list_to_dict", "macro_sql": "{% macro column_list_to_dict(column_list) %}\n{# This macro converts the list of dictionaries generated by the `get_*_columns` macros into a dictionary of dictionaries for use in the `coalesce_rename` macro. This conversion is necessary so that each column dictionary entry can be accessed by a key, rather than iterating through a list. #}\n {%- set column_dict = {} -%}\n {%- for col in column_list -%}\n {%- do column_dict.update({col.name: col}) if not col.is_rename -%}\n {%- endfor -%}\n {{ return(column_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.0408099, "supported_languages": null}, "macro.salesforce_source.get_opportunity_columns": {"name": "get_opportunity_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_opportunity_columns.sql", "original_file_path": "macros/get_opportunity_columns.sql", "unique_id": "macro.salesforce_source.get_opportunity_columns", "macro_sql": "{% macro get_opportunity_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": \"boolean\"},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"amount\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"close_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"expected_revenue\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"fiscal\", \"datatype\": dbt.type_string()},\n {\"name\": \"fiscal_quarter\", \"datatype\": dbt.type_int()},\n {\"name\": \"fiscal_year\", \"datatype\": dbt.type_int()},\n {\"name\": \"forecast_category\", \"datatype\": dbt.type_string()},\n {\"name\": \"forecast_category_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"has_open_activity\", \"datatype\": \"boolean\"},\n {\"name\": \"has_opportunity_line_item\", \"datatype\": \"boolean\"},\n {\"name\": \"has_overdue_task\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_closed\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_won\", \"datatype\": \"boolean\"},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"lead_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"next_step\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"probability\", \"datatype\": dbt.type_float()},\n {\"name\": \"record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"stage_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"synced_quote_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__opportunity_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.044694, "supported_languages": null}, "macro.salesforce_source.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_event_columns.sql", "original_file_path": "macros/get_event_columns.sql", "unique_id": "macro.salesforce_source.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"activity_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"end_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"end_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"event_subtype\", \"datatype\": dbt.type_string()},\n {\"name\": \"group_event_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"is_child\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_group_event\", \"datatype\": \"boolean\"},\n {\"name\": \"is_recurrence\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"location\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"start_date_time\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"what_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"what_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"who_count\", \"datatype\": dbt.type_int()},\n {\"name\": \"who_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__event_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.0481348, "supported_languages": null}, "macro.salesforce_source.get_lead_columns": {"name": "get_lead_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_lead_columns.sql", "original_file_path": "macros/get_lead_columns.sql", "unique_id": "macro.salesforce_source.get_lead_columns", "macro_sql": "{% macro get_lead_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"annual_revenue\", \"datatype\": dbt.type_float()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"converted_account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"converted_contact_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"converted_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"converted_opportunity_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"country_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_bounced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email_bounced_reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"has_opted_out_of_email\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"individual_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_converted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"is_unread_by_owner\", \"datatype\": \"boolean\"},\n {\"name\": \"last_activity_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"lead_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"master_record_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"mobile_phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_employees\", \"datatype\": dbt.type_int()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone\", \"datatype\": dbt.type_string()},\n {\"name\": \"postal_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"state_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"street\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"website\", \"datatype\": dbt.type_string()},\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__lead_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_float", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.053591, "supported_languages": null}, "macro.salesforce_source.get_opportunity_line_item_columns": {"name": "get_opportunity_line_item_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/get_opportunity_line_item_columns.sql", "original_file_path": "macros/get_opportunity_line_item_columns.sql", "unique_id": "macro.salesforce_source.get_opportunity_line_item_columns", "macro_sql": "{% macro get_opportunity_line_item_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_active\", \"datatype\": dbt.type_boolean()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"discount\", \"datatype\": dbt.type_float()},\n {\"name\": \"has_quantity_schedule\", \"datatype\": \"boolean\"},\n {\"name\": \"has_revenue_schedule\", \"datatype\": \"boolean\"},\n {\"name\": \"has_schedule\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"last_modified_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_modified_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_referenced_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"last_viewed_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"list_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"opportunity_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"pricebook_entry_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"product_2_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"product_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"quantity\", \"datatype\": dbt.type_float()},\n {\"name\": \"service_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"sort_order\", \"datatype\": dbt.type_int()},\n {\"name\": \"total_price\", \"datatype\": dbt.type_float()},\n {\"name\": \"unit_price\", \"datatype\": dbt.type_float()}\n] %}\n\n{{ salesforce_source.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__opportunity_line_item_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_boolean", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_int", "macro.salesforce_source.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.0565739, "supported_languages": null}, "macro.salesforce_source.add_renamed_columns": {"name": "add_renamed_columns", "resource_type": "macro", "package_name": "salesforce_source", "path": "macros/add_renamed_columns.sql", "original_file_path": "macros/add_renamed_columns.sql", "unique_id": "macro.salesforce_source.add_renamed_columns", "macro_sql": "{% macro add_renamed_columns(column_list) %}\n{# This macro determines the original names for each column and adds them to the list generated within each `get_*_columns` macro. By default, this macro processes column names by removing underscores and capitalizing each part that follows an underscore. This ensures all necessary columns are available for use in the `coalesce_rename` macro. Additionally, this macro tags each column with its renamed version to maintain tracking. #}\n\n{%- set renamed_columns = [] %}\n\n{%- for col in column_list %}\n\n {%- set original_column_name = col.name %}\n\n {%- if 'fivetran' not in original_column_name %}\n {# Use renamed_column_name value if it provided in the get_columns macro #}\n {%- set renamed_column_name = col.renamed_column_name | default(original_column_name.split('_') | map('capitalize') | join('')) %}\n\n {# Add an entry to the list of renames to populate the filled columns if the rename is different #}\n {%- do renamed_columns.append({\"name\": renamed_column_name, \"datatype\": col.datatype, \"is_rename\": true}) if renamed_column_name|lower != original_column_name|lower %}\n\n {# Update the original column with the renamed column name for use later. #}\n {%- set col = col.update({ \"renamed_column_name\": renamed_column_name, \"is_rename\": false}) %}\n {%- endif %}\n{%- endfor %}\n\n{%- do column_list.extend(renamed_columns) %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1721770461.057628, "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.salesforce.avg_bookings_amount": {"name": "avg_bookings_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_bookings_amount", "block_contents": "The average opportunity amount, if status is won."}, "doc.salesforce.avg_days_open": {"name": "avg_days_open", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_days_open", "block_contents": "The average days since created across opportunties in the pipeline."}, "doc.salesforce.avg_days_to_close": {"name": "avg_days_to_close", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_days_to_close", "block_contents": "The average days to close across opportunties in that have been won."}, "doc.salesforce.avg_pipeline_opp_amount": {"name": "avg_pipeline_opp_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.avg_pipeline_opp_amount", "block_contents": "The average opportunity amount, if status is pipeline."}, "doc.salesforce.bookings_amount_closed_this_month": {"name": "bookings_amount_closed_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_amount_closed_this_month", "block_contents": "The opportunity amount, if closed this month and status is won."}, "doc.salesforce.bookings_amount_closed_this_quarter": {"name": "bookings_amount_closed_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_amount_closed_this_quarter", "block_contents": "The opportunity amount, if closed this quarter and status is won."}, "doc.salesforce.bookings_count_closed_this_month": {"name": "bookings_count_closed_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_count_closed_this_month", "block_contents": "The opportunity count, if closed this month and status is won."}, "doc.salesforce.bookings_count_closed_this_quarter": {"name": "bookings_count_closed_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.bookings_count_closed_this_quarter", "block_contents": "The opportunity count, if closed this quarter and status is won."}, "doc.salesforce.largest_booking": {"name": "largest_booking", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.largest_booking", "block_contents": "The largest amount associated with a single opportunity."}, "doc.salesforce.largest_deal_in_pipeline": {"name": "largest_deal_in_pipeline", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.largest_deal_in_pipeline", "block_contents": "The largest amount associated with a single opportunity in the current pipeline."}, "doc.salesforce.lost_amount_this_month": {"name": "lost_amount_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_amount_this_month", "block_contents": "The opportunity amount, if closed this month and status is lost."}, "doc.salesforce.lost_amount_this_quarter": {"name": "lost_amount_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_amount_this_quarter", "block_contents": "The opportunity amount, if closed this quarter and status is lost."}, "doc.salesforce.lost_count_this_month": {"name": "lost_count_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_count_this_month", "block_contents": "The opportunity count, if closed this month and status is lost."}, "doc.salesforce.lost_count_this_quarter": {"name": "lost_count_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lost_count_this_quarter", "block_contents": "The opportunity count, if closed this quarter and status is lost."}, "doc.salesforce.owner_id": {"name": "owner_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.owner_id", "block_contents": "Id of the owner of this opportunity"}, "doc.salesforce.pipeline_count_created_this_month": {"name": "pipeline_count_created_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_count_created_this_month", "block_contents": "The opportunity count, if closed this month and status is pipeline."}, "doc.salesforce.pipeline_count_created_this_quarter": {"name": "pipeline_count_created_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_count_created_this_quarter", "block_contents": "The opportunity count, if closed this quarter and status is pipeline."}, "doc.salesforce.pipeline_created_amount_this_month": {"name": "pipeline_created_amount_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_amount_this_month", "block_contents": "The opportunity amount, if closed this month and status is pipeline."}, "doc.salesforce.pipeline_created_amount_this_quarter": {"name": "pipeline_created_amount_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_amount_this_quarter", "block_contents": "The opportunity amount, if closed this quarter and status is pipeline."}, "doc.salesforce.pipeline_created_forecast_amount_this_month": {"name": "pipeline_created_forecast_amount_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_forecast_amount_this_month", "block_contents": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline."}, "doc.salesforce.pipeline_created_forecast_amount_this_quarter": {"name": "pipeline_created_forecast_amount_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_created_forecast_amount_this_quarter", "block_contents": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline."}, "doc.salesforce.total_bookings_amount": {"name": "total_bookings_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_bookings_amount", "block_contents": "The opportunity amount, if status is won."}, "doc.salesforce.total_lost_amount": {"name": "total_lost_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_lost_amount", "block_contents": "The opportunity amount, if status is lost."}, "doc.salesforce.total_number_bookings": {"name": "total_number_bookings", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_number_bookings", "block_contents": "The opportunity count, if status is won."}, "doc.salesforce.total_number_lost": {"name": "total_number_lost", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_number_lost", "block_contents": "The opportunity count, if status is lost."}, "doc.salesforce.total_number_pipeline": {"name": "total_number_pipeline", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_number_pipeline", "block_contents": "The opportunity count, if status is pipeline."}, "doc.salesforce.total_pipeline_amount": {"name": "total_pipeline_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_pipeline_amount", "block_contents": "The opportunity amount, if status is pipeline."}, "doc.salesforce.total_pipeline_forecast_amount": {"name": "total_pipeline_forecast_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_pipeline_forecast_amount", "block_contents": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline."}, "doc.salesforce.total_win_percent": {"name": "total_win_percent", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_win_percent", "block_contents": "The booking amount closed, divided by the sum of the booking amount and the lost amount.."}, "doc.salesforce.win_percent_this_month": {"name": "win_percent_this_month", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.win_percent_this_month", "block_contents": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month."}, "doc.salesforce.win_percent_this_quarter": {"name": "win_percent_this_quarter", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.win_percent_this_quarter", "block_contents": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter."}, "doc.salesforce.contact_id": {"name": "contact_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_id", "block_contents": "Unique contact ID."}, "doc.salesforce.contact_name": {"name": "contact_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_name", "block_contents": "Name of contact."}, "doc.salesforce.account_id": {"name": "account_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_id", "block_contents": "ID of contact's account."}, "doc.salesforce.department": {"name": "department", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.department", "block_contents": "The contact\u2019s department."}, "doc.salesforce.contact_description": {"name": "contact_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_description", "block_contents": "A description of the contact."}, "doc.salesforce.email": {"name": "email", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.email", "block_contents": "The contact\u2019s email address."}, "doc.salesforce.individual_id": {"name": "individual_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.individual_id", "block_contents": "ID of the data privacy record associated with this contact. This field is available if Data Protection and Privacy is enabled. This is a relationship field."}, "doc.salesforce.contact_is_deleted": {"name": "contact_is_deleted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_is_deleted", "block_contents": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "doc.salesforce.last_activity_date": {"name": "last_activity_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.last_activity_date", "block_contents": "Value is the most recent of either:\nDue date of the most recent event logged against the record.\nDue date of the most recently closed task associated with the record."}, "doc.salesforce.lead_source": {"name": "lead_source", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.lead_source", "block_contents": "The lead\u2019s source."}, "doc.salesforce.mailing_city": {"name": "mailing_city", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_city", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_country": {"name": "mailing_country", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_country", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_country_code": {"name": "mailing_country_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_country_code", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_postal_code": {"name": "mailing_postal_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_postal_code", "block_contents": "The ISO codes for the mailing address\u2019s state and country."}, "doc.salesforce.mailing_state": {"name": "mailing_state", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_state", "block_contents": "Mailing address details."}, "doc.salesforce.mailing_state_code": {"name": "mailing_state_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_state_code", "block_contents": "The ISO codes for the mailing address\u2019s state and country."}, "doc.salesforce.mailing_street": {"name": "mailing_street", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mailing_street", "block_contents": "Street address for mailing address."}, "doc.salesforce.master_record_id": {"name": "master_record_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.master_record_id", "block_contents": "If this record was deleted as the result of a merge, this field contains the ID of the record that remains. If this record was deleted for any other reason, or has not been deleted, the value is null."}, "doc.salesforce.mobile_phone": {"name": "mobile_phone", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.mobile_phone", "block_contents": "Contact\u2019s mobile phone number."}, "doc.salesforce.contact_owner_id": {"name": "contact_owner_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_owner_id", "block_contents": "The ID of the owner of the account associated with this contact."}, "doc.salesforce.phone": {"name": "phone", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.phone", "block_contents": "Telephone number for the contact. Label is Business Phone."}, "doc.salesforce.reports_to_id": {"name": "reports_to_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.reports_to_id", "block_contents": "This field doesn\u2019t appear if IsPersonAccount is true.\nThis is a relationship field."}, "doc.salesforce.contact_owner_name": {"name": "contact_owner_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.contact_owner_name", "block_contents": "Name of owner of the account associated with this contact."}, "doc.salesforce.account_name": {"name": "account_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_name", "block_contents": "Name of the account."}, "doc.salesforce.account_number": {"name": "account_number", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_number", "block_contents": "Account number assigned to this account (not the unique, system-generated ID assigned during creation)."}, "doc.salesforce.account_source": {"name": "account_source", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_source", "block_contents": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "doc.salesforce.account_annual_revenue": {"name": "account_annual_revenue", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_annual_revenue", "block_contents": "Estimated annual revenue of the account."}, "doc.salesforce.account_description": {"name": "account_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_description", "block_contents": "Text description of the account."}, "doc.salesforce.account_industry": {"name": "account_industry", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_industry", "block_contents": "An industry associated with this account."}, "doc.salesforce.account_is_deleted": {"name": "account_is_deleted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_is_deleted", "block_contents": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "doc.salesforce.account_number_of_employees": {"name": "account_number_of_employees", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_number_of_employees", "block_contents": "Number of employees working at the company represented by this account."}, "doc.salesforce.account_owner_id": {"name": "account_owner_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_owner_id", "block_contents": "The ID of the user who currently owns this account."}, "doc.salesforce.account_parent_id": {"name": "account_parent_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_parent_id", "block_contents": "ID of the account parent object, if any."}, "doc.salesforce.account_rating": {"name": "account_rating", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_rating", "block_contents": "The account\u2019s prospect rating, for example Hot, Warm, or Cold."}, "doc.salesforce.account_type": {"name": "account_type", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.account_type", "block_contents": "Type of account, for example, Customer, Competitor, or Partner."}, "doc.salesforce.date_day": {"name": "date_day", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.date_day", "block_contents": "Day of event, in UTC."}, "doc.salesforce.leads_created": {"name": "leads_created", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.leads_created", "block_contents": "Number of leads created on that date."}, "doc.salesforce.leads_converted": {"name": "leads_converted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.leads_converted", "block_contents": "Number of leads converted on that date."}, "doc.salesforce.tasks_completed": {"name": "tasks_completed", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.tasks_completed", "block_contents": "Number of tasks for that activity date."}, "doc.salesforce.events_completed": {"name": "events_completed", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.events_completed", "block_contents": "Number of events for that activity date."}, "doc.salesforce.opportunities_created": {"name": "opportunities_created", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_created", "block_contents": "Number of opportunities created on that date."}, "doc.salesforce.opportunities_won": {"name": "opportunities_won", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_won", "block_contents": "Number of opportunities won on that close date."}, "doc.salesforce.opportunities_lost": {"name": "opportunities_lost", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_lost", "block_contents": "Number of opportunities lost on that close date."}, "doc.salesforce.opportunity_line_item_id": {"name": "opportunity_line_item_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_line_item_id", "block_contents": "The unique ID for each opportunity line item."}, "doc.salesforce.opportunity_line_item_name": {"name": "opportunity_line_item_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_line_item_name", "block_contents": "The unique name for each opportunity line item."}, "doc.salesforce.opportunity_line_item_description": {"name": "opportunity_line_item_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_line_item_description", "block_contents": "Text description of the opportunity line item."}, "doc.salesforce.opportunity_id": {"name": "opportunity_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunity_id", "block_contents": "ID of the associated Opportunity."}, "doc.salesforce.line_item_index": {"name": "line_item_index", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.line_item_index", "block_contents": "The index number of the specific line item, relative to all line items in that opportunity."}, "doc.salesforce.total_line_items": {"name": "total_line_items", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_line_items", "block_contents": "The total number of line items belonging to the same opportunity."}, "doc.salesforce.created_date": {"name": "created_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.created_date", "block_contents": "Created date."}, "doc.salesforce.last_modified_date": {"name": "last_modified_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.last_modified_date", "block_contents": "Last Modified Date."}, "doc.salesforce.service_date": {"name": "service_date", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.service_date", "block_contents": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored."}, "doc.salesforce.pricebook_entry_id": {"name": "pricebook_entry_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pricebook_entry_id", "block_contents": "ID of the associated PricebookEntry. Exists only for those organizations that have Products enabled as a feature. In API versions 1.0 and 2.0, you can specify values for either this field or ProductId, but not both. For this reason, both fields are declared nillable. In API version 3.0 and later, you must specify values for this field instead of ProductId. This is a relationship field."}, "doc.salesforce.product_2_id": {"name": "product_2_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_2_id", "block_contents": "The ID of the related Product2 record. This is a read-only field available in API version 30.0 and later.\nUse the PricebookEntryId field instead, specifying the ID of the PricebookEntry record."}, "doc.salesforce.product_2_name": {"name": "product_2_name", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_2_name", "block_contents": "Default name of the product."}, "doc.salesforce.product_code": {"name": "product_code", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_code", "block_contents": "This read-only field is available in API version 30.0 and later. It references the value in the ProductCode field of the related Product2 record."}, "doc.salesforce.product_2_description": {"name": "product_2_description", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_2_description", "block_contents": "A text description of the product."}, "doc.salesforce.list_price": {"name": "list_price", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.list_price", "block_contents": "Corresponds to the UnitPrice on the PricebookEntry that is associated with this line item, which can be in the standard price book or a custom price book. A client application can use this information to show whether the unit price (or sales price) of the line item differs from the price book entry list price."}, "doc.salesforce.quantity": {"name": "quantity", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.quantity", "block_contents": "Read-only if this record has a quantity schedule, a revenue schedule, or both a quantity and a revenue schedule.\nWhen updating these records:\nIf you specify Quantity without specifying the UnitPrice, the UnitPrice value will be adjusted to accommodate the new Quantity value, and the TotalPrice will be held constant.\nIf you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system can determine which one to automatically adjust."}, "doc.salesforce.unit_price": {"name": "unit_price", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.unit_price", "block_contents": "The unit price for the opportunity line item. In the Salesforce user interface, this field\u2019s value is calculated by dividing the total price of the opportunity line item by the quantity listed for that line item. Label is Sales Price.\nThis field or TotalPrice is required. You can\u2019t specify both.\n\nIf you specify Discount and Quantity, this field or TotalPrice is required."}, "doc.salesforce.total_price": {"name": "total_price", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.total_price", "block_contents": "This field is available only for backward compatibility. It represents the total price of the OpportunityLineItem.\nIf you do not specify UnitPrice, this field is required. If you specify Discount and Quantity, this field or UnitPrice is required. When updating these records, you can change either this value or the UnitPrice, but not both at the same time.\n\nThis field is nullable, but you can\u2019t set both TotalPrice and UnitPrice to null in the same update request. To insert the TotalPrice via the API (given only a unit price and the quantity), calculate this field as the unit price multiplied by the quantity. This field is read-only if the opportunity line item has a revenue schedule. If the opportunity line item does not have a schedule or only has quantity schedule, this field can be updated."}, "doc.salesforce.has_quantity_schedule": {"name": "has_quantity_schedule", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.has_quantity_schedule", "block_contents": "Indicates whether a quantity schedule has been created for this object (true) or not (false)."}, "doc.salesforce.has_revenue_schedule": {"name": "has_revenue_schedule", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.has_revenue_schedule", "block_contents": "Indicates whether a revenue schedule has been created for this object (true) or not (false). If this object has a revenue schedule, the Quantity and TotalPrice fields can\u2019t be updated. In addition, the Quantity field can\u2019t be updated if this object has a quantity schedule. Update requests aren\u2019t rejected but the updated values are ignored."}, "doc.salesforce.product_external_id": {"name": "product_external_id", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_external_id", "block_contents": "The unique identifier of the product in the linked external data source. For example, ID #123."}, "doc.salesforce.product_family": {"name": "product_family", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_family", "block_contents": "Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family."}, "doc.salesforce.product_is_active": {"name": "product_is_active", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_is_active", "block_contents": "Indicates whether product is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active."}, "doc.salesforce.product_is_archived": {"name": "product_is_archived", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_is_archived", "block_contents": "Describes whether the product is archived. The default value is false."}, "doc.salesforce.product_is_deleted": {"name": "product_is_deleted", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_is_deleted", "block_contents": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "doc.salesforce.product_number_of_quantity_installments": {"name": "product_number_of_quantity_installments", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_number_of_quantity_installments", "block_contents": "If the product has a quantity schedule, the number of installments."}, "doc.salesforce.product_quantity_installment_period": {"name": "product_quantity_installment_period", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_quantity_installment_period", "block_contents": "If the product has a quantity schedule, the amount of time covered by the schedule."}, "doc.salesforce.product_quantity_schedule_type": {"name": "product_quantity_schedule_type", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_quantity_schedule_type", "block_contents": "The type of the quantity schedule, if the product has one."}, "doc.salesforce.product_quantity_unit_of_measure": {"name": "product_quantity_unit_of_measure", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_quantity_unit_of_measure", "block_contents": "Unit of the product; for example, kilograms, liters, or cases. This field comes with only one value, Each, so consider creating your own. The QuantityUnitOfMeasure field on ProductItem inherits this field\u2019s values."}, "doc.salesforce.product_number_of_revenue_installments": {"name": "product_number_of_revenue_installments", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_number_of_revenue_installments", "block_contents": "If the product has a revenue schedule, the number of installments."}, "doc.salesforce.product_revenue_installment_period": {"name": "product_revenue_installment_period", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_revenue_installment_period", "block_contents": "If the product has a revenue schedule, the time period covered by the schedule."}, "doc.salesforce.product_revenue_schedule_type": {"name": "product_revenue_schedule_type", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.product_revenue_schedule_type", "block_contents": "The type of the revenue schedule, if the product has one."}, "doc.salesforce.opportunities_created_amount": {"name": "opportunities_created_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_created_amount", "block_contents": "The dollar amount of all opportunities created for this day."}, "doc.salesforce.opportunities_won_amount": {"name": "opportunities_won_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_won_amount", "block_contents": "The dollar amount of all opportunities won for this day."}, "doc.salesforce.opportunities_lost_amount": {"name": "opportunities_lost_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.opportunities_lost_amount", "block_contents": "The dollar amount of all opportunities lost for this day."}, "doc.salesforce.pipeline_amount": {"name": "pipeline_amount", "resource_type": "doc", "package_name": "salesforce", "path": "salesforce.md", "original_file_path": "models/salesforce.md", "unique_id": "doc.salesforce.pipeline_amount", "block_contents": "The dollar amount of all opportunities in the pipeline for this day."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.salesforce_integration_tests.consistency_daily_activity_count": [{"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "consistency_daily_activity_count", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_daily_activity_count.sql", "original_file_path": "tests/consistency/consistency_daily_activity_count.sql", "unique_id": "test.salesforce_integration_tests.consistency_daily_activity_count", "fqn": ["salesforce_integration_tests", "consistency", "consistency_daily_activity_count"], "alias": "consistency_daily_activity_count", "checksum": {"name": "sha256", "checksum": "b8e0325309076328ccbce499ce320154cf7f901f007dcefdf448d0f88315ed6c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1721770461.434274, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test is to make sure the rows counts are the same between versions\nwith prod as (\n select count(*) as prod_rows\n from {{ target.schema }}_salesforce_prod.salesforce__daily_activity\n),\n\ndev as (\n select count(*) as dev_rows\n from {{ target.schema }}_salesforce_dev.salesforce__daily_activity\n)\n\n-- test will return values and fail if the row counts don't match\nselect *\nfrom prod\njoin dev\n on prod.prod_rows != dev.dev_rows", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_columns": [{"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "consistency_columns", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_columns.sql", "original_file_path": "tests/consistency/consistency_columns.sql", "unique_id": "test.salesforce_integration_tests.consistency_columns", "fqn": ["salesforce_integration_tests", "consistency", "consistency_columns"], "alias": "consistency_columns", "checksum": {"name": "sha256", "checksum": "112a621e602d265bf848bf92fd3c27808e1ba195861bd112a57a10a6988fc78e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1721770461.451513, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n/* This test is to make sure the final columns produced are the same between versions.\nOnly one test is needed since it will fetch all tables and all columns in each schema.\n!!! THIS TEST IS WRITTEN FOR BIGQUERY!!! */\n{% if target.type == 'bigquery' %}\nwith prod as (\n select\n table_name,\n column_name,\n data_type\n from {{ target.schema }}_salesforce_prod.INFORMATION_SCHEMA.COLUMNS\n),\n\ndev as (\n select\n table_name,\n column_name,\n data_type\n from {{ target.schema }}_salesforce_dev.INFORMATION_SCHEMA.COLUMNS\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\n\n{% else %}\n{{ print('This is written to run on bigquery. If you need to run on another warehouse, add another version for that warehouse') }}\n\n{% endif %}", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_daily_activity": [{"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "consistency_daily_activity", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_daily_activity.sql", "original_file_path": "tests/consistency/consistency_daily_activity.sql", "unique_id": "test.salesforce_integration_tests.consistency_daily_activity", "fqn": ["salesforce_integration_tests", "consistency", "consistency_daily_activity"], "alias": "consistency_daily_activity", "checksum": {"name": "sha256", "checksum": "592ef9765cc755f63e9cb279e716197c5bcf27c79aca7b9c6f1b927768d718b4"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1721770461.454985, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test ensures the daily_activity end model matches the prior version\nwith prod as (\n select *\n from {{ target.schema }}_salesforce_prod.salesforce__daily_activity\n where date(date_day) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select *\n from {{ target.schema }}_salesforce_dev.salesforce__daily_activity\n where date(date_day) < 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", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.integrity_daily_activity": [{"database": "postgres", "schema": "zz_salesforce_dbt_test__audit", "name": "integrity_daily_activity", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "integrity/integrity_daily_activity.sql", "original_file_path": "tests/integrity/integrity_daily_activity.sql", "unique_id": "test.salesforce_integration_tests.integrity_daily_activity", "fqn": ["salesforce_integration_tests", "integrity", "integrity_daily_activity"], "alias": "integrity_daily_activity", "checksum": {"name": "sha256", "checksum": "789a0f94dc8007ba5b1c60c235b74efc7ab210eeeb7e5b9c42d42a6da6ee682f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": 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": false}, "created_at": 1721770461.460413, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test is to make sure there is no fanout between the spine and the daily_activity\nwith spine as (\n select count(*) as spine_count\n from {{ target.schema }}_salesforce_dev.int_salesforce__date_spine\n),\n\ndaily_activity as (\n select count(*) as daily_activity_count\n from {{ target.schema }}_salesforce_dev.salesforce__daily_activity\n)\n\n-- test will return values and fail if the row counts don't match\nselect *\nfrom spine\njoin daily_activity\n on spine.spine_count != daily_activity.daily_activity_count", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}]}, "parent_map": {"seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_opportunity_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "model.salesforce.salesforce__contact_daily_history": ["model.salesforce_source.stg_salesforce__contact_history"], "model.salesforce.salesforce__opportunity_daily_history": ["model.salesforce_source.stg_salesforce__opportunity_history"], "model.salesforce.salesforce__account_daily_history": ["model.salesforce_source.stg_salesforce__account_history"], "model.salesforce.salesforce__opportunity_enhanced": ["model.salesforce_source.stg_salesforce__account", "model.salesforce_source.stg_salesforce__opportunity", "model.salesforce_source.stg_salesforce__user", "model.salesforce_source.stg_salesforce__user_role"], "model.salesforce.salesforce__owner_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user"], "model.salesforce.salesforce__opportunity_line_item_enhanced": ["model.salesforce_source.stg_salesforce__opportunity_line_item", "model.salesforce_source.stg_salesforce__product_2"], "model.salesforce.salesforce__sales_snapshot": ["model.salesforce.salesforce__opportunity_enhanced"], "model.salesforce.salesforce__contact_enhanced": ["model.salesforce_source.stg_salesforce__account", "model.salesforce_source.stg_salesforce__contact", "model.salesforce_source.stg_salesforce__user"], "model.salesforce.salesforce__daily_activity": ["model.salesforce.int_salesforce__date_spine", "model.salesforce_source.stg_salesforce__event", "model.salesforce_source.stg_salesforce__lead", "model.salesforce_source.stg_salesforce__opportunity", "model.salesforce_source.stg_salesforce__task"], "model.salesforce.salesforce__manager_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce_source.stg_salesforce__user", "model.salesforce_source.stg_salesforce__user_role"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce_source.stg_salesforce__user"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce_source.stg_salesforce__lead"], "model.salesforce_source.stg_salesforce__opportunity_history": ["source.salesforce_source.salesforce_history.opportunity"], "model.salesforce_source.stg_salesforce__account_history": ["source.salesforce_source.salesforce_history.account"], "model.salesforce_source.stg_salesforce__contact_history": ["source.salesforce_source.salesforce_history.contact"], "model.salesforce_source.stg_salesforce__opportunity": ["source.salesforce_source.salesforce.opportunity"], "model.salesforce_source.stg_salesforce__user_role": ["source.salesforce_source.salesforce.user_role"], "model.salesforce_source.stg_salesforce__contact": ["source.salesforce_source.salesforce.contact"], "model.salesforce_source.stg_salesforce__account": ["source.salesforce_source.salesforce.account"], "model.salesforce_source.stg_salesforce__lead": ["source.salesforce_source.salesforce.lead"], "model.salesforce_source.stg_salesforce__order": ["source.salesforce_source.salesforce.order"], "model.salesforce_source.stg_salesforce__event": ["source.salesforce_source.salesforce.event"], "model.salesforce_source.stg_salesforce__product_2": ["source.salesforce_source.salesforce.product_2"], "model.salesforce_source.stg_salesforce__opportunity_line_item": ["source.salesforce_source.salesforce.opportunity_line_item"], "model.salesforce_source.stg_salesforce__user": ["source.salesforce_source.salesforce.user"], "model.salesforce_source.stg_salesforce__task": ["source.salesforce_source.salesforce.task"], "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": ["model.salesforce.salesforce__account_daily_history"], "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb": ["model.salesforce.salesforce__account_daily_history"], "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c": ["model.salesforce.salesforce__contact_daily_history"], "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52": ["model.salesforce.salesforce__contact_daily_history"], "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849": ["model.salesforce.salesforce__opportunity_daily_history"], "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660": ["model.salesforce.salesforce__opportunity_daily_history"], "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": ["model.salesforce.salesforce__manager_performance"], "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781": ["model.salesforce.salesforce__manager_performance"], "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7": ["model.salesforce.salesforce__owner_performance"], "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7": ["model.salesforce.salesforce__owner_performance"], "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc": ["model.salesforce.salesforce__opportunity_enhanced"], "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788": ["model.salesforce.salesforce__opportunity_enhanced"], "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e": ["model.salesforce.salesforce__contact_enhanced"], "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93": ["model.salesforce.salesforce__contact_enhanced"], "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04": ["model.salesforce.salesforce__daily_activity"], "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8": ["model.salesforce.salesforce__daily_activity"], "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32": ["model.salesforce.salesforce__opportunity_line_item_enhanced"], "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa": ["model.salesforce.salesforce__opportunity_line_item_enhanced"], "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": ["model.salesforce_source.stg_salesforce__account_history"], "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f": ["model.salesforce_source.stg_salesforce__account_history"], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6": ["model.salesforce_source.stg_salesforce__account_history"], "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": ["model.salesforce_source.stg_salesforce__contact_history"], "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": ["model.salesforce_source.stg_salesforce__contact_history"], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee": ["model.salesforce_source.stg_salesforce__contact_history"], "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": ["model.salesforce_source.stg_salesforce__opportunity_history"], "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": ["model.salesforce_source.stg_salesforce__opportunity_history"], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435": ["model.salesforce_source.stg_salesforce__opportunity_history"], "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4": ["model.salesforce_source.stg_salesforce__account"], "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7": ["model.salesforce_source.stg_salesforce__account"], "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": ["model.salesforce_source.stg_salesforce__opportunity"], "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": ["model.salesforce_source.stg_salesforce__opportunity"], "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65": ["model.salesforce_source.stg_salesforce__user"], "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152": ["model.salesforce_source.stg_salesforce__user"], "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": ["model.salesforce_source.stg_salesforce__user_role"], "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718": ["model.salesforce_source.stg_salesforce__user_role"], "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78": ["model.salesforce_source.stg_salesforce__contact"], "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e": ["model.salesforce_source.stg_salesforce__contact"], "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8": ["model.salesforce_source.stg_salesforce__event"], "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9": ["model.salesforce_source.stg_salesforce__event"], "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": ["model.salesforce_source.stg_salesforce__lead"], "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282": ["model.salesforce_source.stg_salesforce__lead"], "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": ["model.salesforce_source.stg_salesforce__opportunity_line_item"], "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": ["model.salesforce_source.stg_salesforce__opportunity_line_item"], "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f": ["model.salesforce_source.stg_salesforce__order"], "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c": ["model.salesforce_source.stg_salesforce__order"], "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": ["model.salesforce_source.stg_salesforce__product_2"], "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": ["model.salesforce_source.stg_salesforce__product_2"], "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9": ["model.salesforce_source.stg_salesforce__task"], "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605": ["model.salesforce_source.stg_salesforce__task"], "source.salesforce_source.salesforce_history.account": [], "source.salesforce_source.salesforce_history.contact": [], "source.salesforce_source.salesforce_history.opportunity": [], "source.salesforce_source.salesforce.account": [], "source.salesforce_source.salesforce.opportunity": [], "source.salesforce_source.salesforce.user": [], "source.salesforce_source.salesforce.user_role": [], "source.salesforce_source.salesforce.contact": [], "source.salesforce_source.salesforce.event": [], "source.salesforce_source.salesforce.lead": [], "source.salesforce_source.salesforce.opportunity_line_item": [], "source.salesforce_source.salesforce.order": [], "source.salesforce_source.salesforce.product_2": [], "source.salesforce_source.salesforce.task": [], "source.salesforce_source.salesforce.fivetran_formula": [], "source.salesforce_source.salesforce.fivetran_formula_model": []}, "child_map": {"seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_opportunity_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "model.salesforce.salesforce__contact_daily_history": ["test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52", "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c"], "model.salesforce.salesforce__opportunity_daily_history": ["test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660", "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849"], "model.salesforce.salesforce__account_daily_history": ["test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb", "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581"], "model.salesforce.salesforce__opportunity_enhanced": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.salesforce__sales_snapshot", "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc", "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788"], "model.salesforce.salesforce__owner_performance": ["test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7", "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7"], "model.salesforce.salesforce__opportunity_line_item_enhanced": ["test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa", "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32"], "model.salesforce.salesforce__sales_snapshot": [], "model.salesforce.salesforce__contact_enhanced": ["test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e"], "model.salesforce.salesforce__daily_activity": ["test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04"], "model.salesforce.salesforce__manager_performance": ["test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__owner_performance"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce.salesforce__daily_activity"], "model.salesforce_source.stg_salesforce__opportunity_history": ["model.salesforce.salesforce__opportunity_daily_history", "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435", "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67"], "model.salesforce_source.stg_salesforce__account_history": ["model.salesforce.salesforce__account_daily_history", "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6", "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f"], "model.salesforce_source.stg_salesforce__contact_history": ["model.salesforce.salesforce__contact_daily_history", "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee", "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d"], "model.salesforce_source.stg_salesforce__opportunity": ["model.salesforce.salesforce__daily_activity", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a"], "model.salesforce_source.stg_salesforce__user_role": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718"], "model.salesforce_source.stg_salesforce__contact": ["model.salesforce.salesforce__contact_enhanced", "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e"], "model.salesforce_source.stg_salesforce__account": ["model.salesforce.salesforce__contact_enhanced", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4", "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7"], "model.salesforce_source.stg_salesforce__lead": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.salesforce__daily_activity", "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282"], "model.salesforce_source.stg_salesforce__order": ["test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f", "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c"], "model.salesforce_source.stg_salesforce__event": ["model.salesforce.salesforce__daily_activity", "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8", "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9"], "model.salesforce_source.stg_salesforce__product_2": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61"], "model.salesforce_source.stg_salesforce__opportunity_line_item": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902"], "model.salesforce_source.stg_salesforce__user": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.salesforce__contact_enhanced", "model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__opportunity_enhanced", "model.salesforce.salesforce__owner_performance", "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65", "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152"], "model.salesforce_source.stg_salesforce__task": ["model.salesforce.salesforce__daily_activity", "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9", "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605"], "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": [], "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb": [], "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c": [], "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52": [], "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849": [], "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660": [], "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": [], "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781": [], "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7": [], "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7": [], "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc": [], "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788": [], "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e": [], "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93": [], "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04": [], "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8": [], "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32": [], "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa": [], "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": [], "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f": [], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6": [], "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": [], "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": [], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee": [], "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": [], "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": [], "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435": [], "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4": [], "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7": [], "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": [], "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": [], "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65": [], "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152": [], "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": [], "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718": [], "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78": [], "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e": [], "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8": [], "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9": [], "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": [], "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282": [], "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": [], "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": [], "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f": [], "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c": [], "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": [], "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": [], "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9": [], "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605": [], "source.salesforce_source.salesforce_history.account": ["model.salesforce_source.stg_salesforce__account_history"], "source.salesforce_source.salesforce_history.contact": ["model.salesforce_source.stg_salesforce__contact_history"], "source.salesforce_source.salesforce_history.opportunity": ["model.salesforce_source.stg_salesforce__opportunity_history"], "source.salesforce_source.salesforce.account": ["model.salesforce_source.stg_salesforce__account"], "source.salesforce_source.salesforce.opportunity": ["model.salesforce_source.stg_salesforce__opportunity"], "source.salesforce_source.salesforce.user": ["model.salesforce_source.stg_salesforce__user"], "source.salesforce_source.salesforce.user_role": ["model.salesforce_source.stg_salesforce__user_role"], "source.salesforce_source.salesforce.contact": ["model.salesforce_source.stg_salesforce__contact"], "source.salesforce_source.salesforce.event": ["model.salesforce_source.stg_salesforce__event"], "source.salesforce_source.salesforce.lead": ["model.salesforce_source.stg_salesforce__lead"], "source.salesforce_source.salesforce.opportunity_line_item": ["model.salesforce_source.stg_salesforce__opportunity_line_item"], "source.salesforce_source.salesforce.order": ["model.salesforce_source.stg_salesforce__order"], "source.salesforce_source.salesforce.product_2": ["model.salesforce_source.stg_salesforce__product_2"], "source.salesforce_source.salesforce.task": ["model.salesforce_source.stg_salesforce__task"], "source.salesforce_source.salesforce.fivetran_formula": [], "source.salesforce_source.salesforce.fivetran_formula_model": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index d52679e..22953d5 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json", "dbt_version": "1.8.3", "generated_at": "2024-07-10T00:47:40.101668Z", "invocation_id": "f1c358ba-eb11-4963-9644-4063866a3763", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.776086Z", "completed_at": "2024-07-10T00:47:38.416778Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.417021Z", "completed_at": "2024-07-10T00:47:38.417029Z"}], "thread_id": "Thread-3", "execution_time": 0.7974791526794434, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__account_history", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\" )\n \n),\n\nfinal as (\n\n select \n id as account_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_number\",\n \"account_source\",\n \"annual_revenue\",\n \"billing_city\",\n \"billing_country\",\n \"billing_postal_code\",\n \"billing_state\",\n \"billing_street\",\n \"description\",\n \"industry\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"master_record_id\",\n \"name\",\n \"number_of_employees\",\n \"owner_id\",\n \"ownership\",\n \"parent_id\",\n \"rating\",\n \"record_type_id\",\n \"shipping_city\",\n \"shipping_country\",\n \"shipping_postal_code\",\n \"shipping_state\",\n \"shipping_street\",\n \"type\",\n \"website\"\n from base\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.734124Z", "completed_at": "2024-07-10T00:47:38.533840Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.534677Z", "completed_at": "2024-07-10T00:47:38.534686Z"}], "thread_id": "Thread-2", "execution_time": 0.8797240257263184, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__account", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_number\n \n as \n \n account_number\n \n, \n \n \n account_source\n \n as \n \n account_source\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n ownership\n \n as \n \n ownership\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n rating\n \n as \n \n rating\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as TEXT) as \n \n AccountNumber\n \n , \n cast(null as TEXT) as \n \n AccountSource\n \n , \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ParentId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_account_data\"\n), \n\nfinal as (\n select\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(AccountNumber as TEXT),\n cast(account_number as TEXT))\n as account_number,\n \n\n\n coalesce(cast(AccountSource as TEXT),\n cast(account_source as TEXT))\n as account_source,\n \n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n cast(Description as TEXT) as account_description,\n \n\n\n cast(Id as TEXT) as account_id,\n \n\n\n cast(Industry as TEXT) as industry,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n cast(Name as TEXT) as account_name,\n \n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Ownership as TEXT) as ownership,\n \n\n\n coalesce(cast(ParentId as TEXT),\n cast(parent_id as TEXT))\n as parent_id,\n \n\n\n cast(Rating as TEXT) as rating,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n cast(Type as TEXT) as type,\n \n\n\n cast(Website as TEXT) as website\n\n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.831505Z", "completed_at": "2024-07-10T00:47:38.534404Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.535599Z", "completed_at": "2024-07-10T00:47:38.535606Z"}], "thread_id": "Thread-6", "execution_time": 0.8861808776855469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__event", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__event_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n activity_date_time\n \n as \n \n activity_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n end_date_time\n \n as \n \n end_date_time\n \n, \n \n \n event_subtype\n \n as \n \n event_subtype\n \n, \n \n \n group_event_type\n \n as \n \n group_event_type\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_child\n \n as \n \n is_child\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_group_event\n \n as \n \n is_group_event\n \n, \n \n \n is_recurrence\n \n as \n \n is_recurrence\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n location\n \n as \n \n location\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n start_date_time\n \n as \n \n start_date_time\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as timestamp) as \n \n ActivityDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as timestamp) as \n \n EndDateTime\n \n , \n cast(null as TEXT) as \n \n EventSubtype\n \n , \n cast(null as TEXT) as \n \n GroupEventType\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsChild\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsGroupEvent\n \n , \n cast(null as boolean) as \n \n IsRecurrence\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as timestamp) as \n \n StartDateTime\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_event_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as event_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n coalesce(cast(ActivityDateTime as timestamp),\n cast(activity_date_time as timestamp))\n as activity_date_time,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as event_description,\n \n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n coalesce(cast(EndDateTime as timestamp),\n cast(end_date_time as timestamp))\n as end_date_time,\n \n\n\n coalesce(cast(EventSubtype as TEXT),\n cast(event_subtype as TEXT))\n as event_subtype,\n \n\n\n coalesce(cast(GroupEventType as TEXT),\n cast(group_event_type as TEXT))\n as group_event_type,\n \n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n coalesce(cast(IsChild as boolean),\n cast(is_child as boolean))\n as is_child,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsGroupEvent as boolean),\n cast(is_group_event as boolean))\n as is_group_event,\n \n\n\n coalesce(cast(IsRecurrence as boolean),\n cast(is_recurrence as boolean))\n as is_recurrence,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n cast(Location as TEXT) as location,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n coalesce(cast(StartDateTime as timestamp),\n cast(start_date_time as timestamp))\n as start_date_time,\n \n\n\n cast(Subject as TEXT) as subject,\n \n\n\n cast(Type as TEXT) as type,\n \n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.823080Z", "completed_at": "2024-07-10T00:47:38.534916Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.535921Z", "completed_at": "2024-07-10T00:47:38.535924Z"}], "thread_id": "Thread-5", "execution_time": 0.8937599658966064, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__contact_history", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\" )\n \n),\n\nfinal as (\n\n select \n id as contact_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"email\",\n \"first_name\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_modified_by_id\",\n \"last_modified_date\",\n \"last_name\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"mailing_city\",\n \"mailing_country\",\n \"mailing_country_code\",\n \"mailing_postal_code\",\n \"mailing_state\",\n \"mailing_street\",\n \"master_record_id\",\n \"mobile_phone\",\n \"name\",\n \"owner_id\",\n \"phone\",\n \"reports_to_id\",\n \"title\",\n \"lead_source\",\n \"description\",\n \"individual_id\",\n \"home_phone\"\n from base\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.875452Z", "completed_at": "2024-07-10T00:47:38.545962Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.546219Z", "completed_at": "2024-07-10T00:47:38.546226Z"}], "thread_id": "Thread-8", "execution_time": 0.9387359619140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__opportunity", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n close_date\n \n as \n \n close_date\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n expected_revenue\n \n as \n \n expected_revenue\n \n, \n \n \n fiscal\n \n as \n \n fiscal\n \n, \n \n \n fiscal_quarter\n \n as \n \n fiscal_quarter\n \n, \n \n \n fiscal_year\n \n as \n \n fiscal_year\n \n, \n \n \n forecast_category\n \n as \n \n forecast_category\n \n, \n \n \n forecast_category_name\n \n as \n \n forecast_category_name\n \n, \n \n \n has_open_activity\n \n as \n \n has_open_activity\n \n, \n \n \n has_opportunity_line_item\n \n as \n \n has_opportunity_line_item\n \n, \n \n \n has_overdue_task\n \n as \n \n has_overdue_task\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_won\n \n as \n \n is_won\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n next_step\n \n as \n \n next_step\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n probability\n \n as \n \n probability\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n stage_name\n \n as \n \n stage_name\n \n, \n \n \n synced_quote_id\n \n as \n \n synced_quote_id\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CampaignId\n \n , \n cast(null as timestamp) as \n \n CloseDate\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as numeric(28,6)) as \n \n ExpectedRevenue\n \n , \n cast(null as integer) as \n \n FiscalQuarter\n \n , \n cast(null as integer) as \n \n FiscalYear\n \n , \n cast(null as TEXT) as \n \n ForecastCategory\n \n , \n cast(null as TEXT) as \n \n ForecastCategoryName\n \n , \n cast(null as boolean) as \n \n HasOpenActivity\n \n , \n cast(null as boolean) as \n \n HasOpportunityLineItem\n \n , \n cast(null as boolean) as \n \n HasOverdueTask\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsWon\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n NextStep\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n StageName\n \n , \n cast(null as TEXT) as \n \n SyncedQuoteId\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n cast(Amount as numeric(28,6)) as amount,\n \n\n\n coalesce(cast(CampaignId as TEXT),\n cast(campaign_id as TEXT))\n as campaign_id,\n \n\n\n coalesce(cast(CloseDate as timestamp),\n cast(close_date as timestamp))\n as close_date,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as opportunity_description,\n \n\n\n coalesce(cast(ExpectedRevenue as numeric(28,6)),\n cast(expected_revenue as numeric(28,6)))\n as expected_revenue,\n \n\n\n cast(Fiscal as TEXT) as fiscal,\n \n\n\n coalesce(cast(FiscalQuarter as integer),\n cast(fiscal_quarter as integer))\n as fiscal_quarter,\n \n\n\n coalesce(cast(FiscalYear as integer),\n cast(fiscal_year as integer))\n as fiscal_year,\n \n\n\n coalesce(cast(ForecastCategory as TEXT),\n cast(forecast_category as TEXT))\n as forecast_category,\n \n\n\n coalesce(cast(ForecastCategoryName as TEXT),\n cast(forecast_category_name as TEXT))\n as forecast_category_name,\n \n\n\n coalesce(cast(HasOpenActivity as boolean),\n cast(has_open_activity as boolean))\n as has_open_activity,\n \n\n\n coalesce(cast(HasOpportunityLineItem as boolean),\n cast(has_opportunity_line_item as boolean))\n as has_opportunity_line_item,\n \n\n\n coalesce(cast(HasOverdueTask as boolean),\n cast(has_overdue_task as boolean))\n as has_overdue_task,\n \n\n\n cast(Id as TEXT) as opportunity_id,\n \n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsWon as boolean),\n cast(is_won as boolean))\n as is_won,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n cast(Name as TEXT) as opportunity_name,\n \n\n\n coalesce(cast(NextStep as TEXT),\n cast(next_step as TEXT))\n as next_step,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Probability as float) as probability,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n coalesce(cast(StageName as TEXT),\n cast(stage_name as TEXT))\n as stage_name,\n \n\n\n coalesce(cast(SyncedQuoteId as TEXT),\n cast(synced_quote_id as TEXT))\n as synced_quote_id,\n \n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n), \n\ncalculated as (\n \n select \n *,\n created_date >= date_trunc('month', \n current_timestamp::timestamp\n) as is_created_this_month,\n created_date >= date_trunc('quarter', \n current_timestamp::timestamp\n) as is_created_this_quarter,\n \n ((created_date)::date - (\n current_timestamp::timestamp\n)::date)\n as days_since_created,\n \n ((created_date)::date - (close_date)::date)\n as days_to_close,\n date_trunc('month', close_date) = date_trunc('month', \n current_timestamp::timestamp\n) as is_closed_this_month,\n date_trunc('quarter', close_date) = date_trunc('quarter', \n current_timestamp::timestamp\n) as is_closed_this_quarter\n from final\n)\n\nselect * \nfrom calculated\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.801564Z", "completed_at": "2024-07-10T00:47:38.624477Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.657544Z", "completed_at": "2024-07-10T00:47:38.657550Z"}], "thread_id": "Thread-4", "execution_time": 1.0173211097717285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__contact", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n home_phone\n \n as \n \n home_phone\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n mailing_city\n \n as \n \n mailing_city\n \n, \n \n \n mailing_country\n \n as \n \n mailing_country\n \n, \n \n \n mailing_country_code\n \n as \n \n mailing_country_code\n \n, \n \n \n mailing_postal_code\n \n as \n \n mailing_postal_code\n \n, \n \n \n mailing_state\n \n as \n \n mailing_state\n \n, \n \n \n mailing_state_code\n \n as \n \n mailing_state_code\n \n, \n \n \n mailing_street\n \n as \n \n mailing_street\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n reports_to_id\n \n as \n \n reports_to_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n HomePhone\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MailingCity\n \n , \n cast(null as TEXT) as \n \n MailingCountry\n \n , \n cast(null as TEXT) as \n \n MailingCountryCode\n \n , \n cast(null as TEXT) as \n \n MailingPostalCode\n \n , \n cast(null as TEXT) as \n \n MailingState\n \n , \n cast(null as TEXT) as \n \n MailingStateCode\n \n , \n cast(null as TEXT) as \n \n MailingStreet\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ReportsToId\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_contact_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as contact_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n cast(Department as TEXT) as department,\n \n\n\n cast(Description as TEXT) as contact_description,\n \n\n\n cast(Email as TEXT) as email,\n \n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n coalesce(cast(HomePhone as TEXT),\n cast(home_phone as TEXT))\n as home_phone,\n \n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n coalesce(cast(MailingCity as TEXT),\n cast(mailing_city as TEXT))\n as mailing_city,\n \n\n\n coalesce(cast(MailingCountry as TEXT),\n cast(mailing_country as TEXT))\n as mailing_country,\n \n\n\n coalesce(cast(MailingCountryCode as TEXT),\n cast(mailing_country_code as TEXT))\n as mailing_country_code,\n \n\n\n coalesce(cast(MailingPostalCode as TEXT),\n cast(mailing_postal_code as TEXT))\n as mailing_postal_code,\n \n\n\n coalesce(cast(MailingState as TEXT),\n cast(mailing_state as TEXT))\n as mailing_state,\n \n\n\n coalesce(cast(MailingStateCode as TEXT),\n cast(mailing_state_code as TEXT))\n as mailing_state_code,\n \n\n\n coalesce(cast(MailingStreet as TEXT),\n cast(mailing_street as TEXT))\n as mailing_street,\n \n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n cast(Name as TEXT) as contact_name,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Phone as TEXT) as phone,\n \n\n\n coalesce(cast(ReportsToId as TEXT),\n cast(reports_to_id as TEXT))\n as reports_to_id,\n \n\n\n cast(Title as TEXT) as title\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.719568Z", "completed_at": "2024-07-10T00:47:38.675698Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.676394Z", "completed_at": "2024-07-10T00:47:38.676399Z"}], "thread_id": "Thread-1", "execution_time": 1.0421209335327148, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.int_salesforce__date_spine", "compiled": true, "compiled_code": "with spine as (\n\n \n\n \n\n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1704\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2019-11-11' as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= \n\n cast('2024-07-10' as date) + ((interval '1 day') * (1))\n\n\n\n)\n\nselect * from filtered\n\n\n)\n\nselect * \nfrom spine", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__date_spine\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:37.849829Z", "completed_at": "2024-07-10T00:47:38.675997Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.676595Z", "completed_at": "2024-07-10T00:47:38.676598Z"}], "thread_id": "Thread-7", "execution_time": 1.039543628692627, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__lead", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__lead_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company\n \n as \n \n company\n \n, \n \n \n converted_account_id\n \n as \n \n converted_account_id\n \n, \n \n \n converted_contact_id\n \n as \n \n converted_contact_id\n \n, \n \n \n converted_date\n \n as \n \n converted_date\n \n, \n \n \n converted_opportunity_id\n \n as \n \n converted_opportunity_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n email_bounced_date\n \n as \n \n email_bounced_date\n \n, \n \n \n email_bounced_reason\n \n as \n \n email_bounced_reason\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n has_opted_out_of_email\n \n as \n \n has_opted_out_of_email\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_converted\n \n as \n \n is_converted\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_unread_by_owner\n \n as \n \n is_unread_by_owner\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n ConvertedAccountId\n \n , \n cast(null as TEXT) as \n \n ConvertedContactId\n \n , \n cast(null as timestamp) as \n \n ConvertedDate\n \n , \n cast(null as TEXT) as \n \n ConvertedOpportunityId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EmailBouncedDate\n \n , \n cast(null as TEXT) as \n \n EmailBouncedReason\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as boolean) as \n \n HasOptedOutOfEmail\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsConverted\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsUnreadByOwner\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_lead_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as lead_id,\n \n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n cast(City as TEXT) as city,\n \n\n\n cast(Company as TEXT) as company,\n \n\n\n coalesce(cast(ConvertedAccountId as TEXT),\n cast(converted_account_id as TEXT))\n as converted_account_id,\n \n\n\n coalesce(cast(ConvertedContactId as TEXT),\n cast(converted_contact_id as TEXT))\n as converted_contact_id,\n \n\n\n coalesce(cast(ConvertedDate as timestamp),\n cast(converted_date as timestamp))\n as converted_date,\n \n\n\n coalesce(cast(ConvertedOpportunityId as TEXT),\n cast(converted_opportunity_id as TEXT))\n as converted_opportunity_id,\n \n\n\n cast(Country as TEXT) as country,\n \n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as lead_description,\n \n\n\n cast(Email as TEXT) as email,\n \n\n\n coalesce(cast(EmailBouncedDate as timestamp),\n cast(email_bounced_date as timestamp))\n as email_bounced_date,\n \n\n\n coalesce(cast(EmailBouncedReason as TEXT),\n cast(email_bounced_reason as TEXT))\n as email_bounced_reason,\n \n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n coalesce(cast(HasOptedOutOfEmail as boolean),\n cast(has_opted_out_of_email as boolean))\n as has_opted_out_of_email,\n \n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n cast(Industry as TEXT) as industry,\n \n\n\n coalesce(cast(IsConverted as boolean),\n cast(is_converted as boolean))\n as is_converted,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsUnreadByOwner as boolean),\n cast(is_unread_by_owner as boolean))\n as is_unread_by_owner,\n \n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n cast(Name as TEXT) as lead_name,\n \n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Phone as TEXT) as phone,\n \n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n cast(State as TEXT) as state,\n \n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n cast(Status as TEXT) as status,\n \n\n\n cast(Street as TEXT) as street,\n \n\n\n cast(Title as TEXT) as title,\n \n\n\n cast(Website as TEXT) as website\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.771024Z", "completed_at": "2024-07-10T00:47:38.772312Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.772841Z", "completed_at": "2024-07-10T00:47:38.772852Z"}], "thread_id": "Thread-7", "execution_time": 0.012798070907592773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_account_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.775116Z", "completed_at": "2024-07-10T00:47:38.776463Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.776714Z", "completed_at": "2024-07-10T00:47:38.776719Z"}], "thread_id": "Thread-7", "execution_time": 0.0022118091583251953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_account_history_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.778040Z", "completed_at": "2024-07-10T00:47:38.779445Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.779729Z", "completed_at": "2024-07-10T00:47:38.779734Z"}], "thread_id": "Thread-7", "execution_time": 0.0024089813232421875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_contact_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.781097Z", "completed_at": "2024-07-10T00:47:38.782424Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.782707Z", "completed_at": "2024-07-10T00:47:38.782712Z"}], "thread_id": "Thread-7", "execution_time": 0.0023832321166992188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_contact_history_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.783984Z", "completed_at": "2024-07-10T00:47:38.785260Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.785494Z", "completed_at": "2024-07-10T00:47:38.785498Z"}], "thread_id": "Thread-7", "execution_time": 0.0020699501037597656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_event_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.786589Z", "completed_at": "2024-07-10T00:47:38.788058Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.788316Z", "completed_at": "2024-07-10T00:47:38.788321Z"}], "thread_id": "Thread-7", "execution_time": 0.002298116683959961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_lead_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.789432Z", "completed_at": "2024-07-10T00:47:38.791333Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.791601Z", "completed_at": "2024-07-10T00:47:38.791607Z"}], "thread_id": "Thread-7", "execution_time": 0.0027008056640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_opportunity_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.792878Z", "completed_at": "2024-07-10T00:47:38.794281Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.794570Z", "completed_at": "2024-07-10T00:47:38.794576Z"}], "thread_id": "Thread-7", "execution_time": 0.002457857131958008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_opportunity_history_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.796007Z", "completed_at": "2024-07-10T00:47:38.797289Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.797543Z", "completed_at": "2024-07-10T00:47:38.797547Z"}], "thread_id": "Thread-7", "execution_time": 0.002212047576904297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_opportunity_line_item_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.798660Z", "completed_at": "2024-07-10T00:47:38.799888Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.800119Z", "completed_at": "2024-07-10T00:47:38.800123Z"}], "thread_id": "Thread-7", "execution_time": 0.002015829086303711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_order_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.801148Z", "completed_at": "2024-07-10T00:47:38.802343Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.802541Z", "completed_at": "2024-07-10T00:47:38.802545Z"}], "thread_id": "Thread-7", "execution_time": 0.0018601417541503906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_product_2_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.803489Z", "completed_at": "2024-07-10T00:47:38.804696Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.804923Z", "completed_at": "2024-07-10T00:47:38.804928Z"}], "thread_id": "Thread-7", "execution_time": 0.0019021034240722656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_task_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.805999Z", "completed_at": "2024-07-10T00:47:38.807806Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.808014Z", "completed_at": "2024-07-10T00:47:38.808018Z"}], "thread_id": "Thread-7", "execution_time": 0.002588033676147461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_user_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.808997Z", "completed_at": "2024-07-10T00:47:38.810231Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:38.810543Z", "completed_at": "2024-07-10T00:47:38.810556Z"}], "thread_id": "Thread-7", "execution_time": 0.0020558834075927734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_user_role_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.524125Z", "completed_at": "2024-07-10T00:47:39.121532Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.121790Z", "completed_at": "2024-07-10T00:47:39.121802Z"}], "thread_id": "Thread-3", "execution_time": 0.6570942401885986, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_history", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\" )\n \n),\n\nfinal as (\n\n select \n id as opportunity_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"amount\",\n \"campaign_id\",\n \"close_date\",\n \"created_date\",\n \"description\",\n \"expected_revenue\",\n \"fiscal\",\n \"fiscal_quarter\",\n \"fiscal_year\",\n \"forecast_category\",\n \"forecast_category_name\",\n \"has_open_activity\",\n \"has_opportunity_line_item\",\n \"has_overdue_task\",\n \"is_closed\",\n \"is_deleted\",\n \"is_won\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"lead_source\",\n \"name\",\n \"next_step\",\n \"owner_id\",\n \"probability\",\n \"record_type_id\",\n \"stage_name\",\n \"synced_quote_id\",\n \"type\"\n from base\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.184753Z", "completed_at": "2024-07-10T00:47:39.206379Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.207089Z", "completed_at": "2024-07-10T00:47:39.207099Z"}], "thread_id": "Thread-3", "execution_time": 0.023967981338500977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n account_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\n group by account_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.208818Z", "completed_at": "2024-07-10T00:47:39.217643Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.217950Z", "completed_at": "2024-07-10T00:47:39.217956Z"}], "thread_id": "Thread-3", "execution_time": 0.009901046752929688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\nwhere history_unique_key is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.219407Z", "completed_at": "2024-07-10T00:47:39.224882Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.225164Z", "completed_at": "2024-07-10T00:47:39.225170Z"}], "thread_id": "Thread-3", "execution_time": 0.006437778472900391, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.612758Z", "completed_at": "2024-07-10T00:47:39.282631Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.282918Z", "completed_at": "2024-07-10T00:47:39.282927Z"}], "thread_id": "Thread-5", "execution_time": 0.740339994430542, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__product_2", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__product_2_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n display_url\n \n as \n \n display_url\n \n, \n \n \n external_id\n \n as \n \n external_id\n \n, \n \n \n family\n \n as \n \n family\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_quantity_installments\n \n as \n \n number_of_quantity_installments\n \n, \n \n \n number_of_revenue_installments\n \n as \n \n number_of_revenue_installments\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity_installment_period\n \n as \n \n quantity_installment_period\n \n, \n \n \n quantity_schedule_type\n \n as \n \n quantity_schedule_type\n \n, \n \n \n quantity_unit_of_measure\n \n as \n \n quantity_unit_of_measure\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n revenue_installment_period\n \n as \n \n revenue_installment_period\n \n, \n \n \n revenue_schedule_type\n \n as \n \n revenue_schedule_type\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as TEXT) as \n \n DisplayUrl\n \n , \n cast(null as TEXT) as \n \n ExternalId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as integer) as \n \n NumberOfQuantityInstallments\n \n , \n cast(null as integer) as \n \n NumberOfRevenueInstallments\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as TEXT) as \n \n QuantityInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n QuantityScheduleType\n \n , \n cast(null as TEXT) as \n \n QuantityUnitOfMeasure\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n RevenueInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n RevenueScheduleType\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_product_2_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as product_2_id,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as product_2_description,\n \n\n\n coalesce(cast(DisplayUrl as TEXT),\n cast(display_url as TEXT))\n as display_url,\n \n\n\n coalesce(cast(ExternalId as TEXT),\n cast(external_id as TEXT))\n as external_id,\n \n\n\n cast(Family as TEXT) as family,\n \n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n cast(Name as TEXT) as product_2_name,\n \n\n\n coalesce(cast(NumberOfQuantityInstallments as integer),\n cast(number_of_quantity_installments as integer))\n as number_of_quantity_installments,\n \n\n\n coalesce(cast(NumberOfRevenueInstallments as integer),\n cast(number_of_revenue_installments as integer))\n as number_of_revenue_installments,\n \n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n coalesce(cast(QuantityInstallmentPeriod as TEXT),\n cast(quantity_installment_period as TEXT))\n as quantity_installment_period,\n \n\n\n coalesce(cast(QuantityScheduleType as TEXT),\n cast(quantity_schedule_type as TEXT))\n as quantity_schedule_type,\n \n\n\n coalesce(cast(QuantityUnitOfMeasure as TEXT),\n cast(quantity_unit_of_measure as TEXT))\n as quantity_unit_of_measure,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n coalesce(cast(RevenueInstallmentPeriod as TEXT),\n cast(revenue_installment_period as TEXT))\n as revenue_installment_period,\n \n\n\n coalesce(cast(RevenueScheduleType as TEXT),\n cast(revenue_schedule_type as TEXT))\n as revenue_schedule_type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.597190Z", "completed_at": "2024-07-10T00:47:39.300311Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.300595Z", "completed_at": "2024-07-10T00:47:39.300600Z"}], "thread_id": "Thread-2", "execution_time": 0.7628726959228516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_line_item", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__opportunity_line_item_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n discount\n \n as \n \n discount\n \n, \n \n \n has_quantity_schedule\n \n as \n \n has_quantity_schedule\n \n, \n \n \n has_revenue_schedule\n \n as \n \n has_revenue_schedule\n \n, \n \n \n has_schedule\n \n as \n \n has_schedule\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n list_price\n \n as \n \n list_price\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n pricebook_entry_id\n \n as \n \n pricebook_entry_id\n \n, \n \n \n product_2_id\n \n as \n \n product_2_id\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n service_date\n \n as \n \n service_date\n \n, \n \n \n sort_order\n \n as \n \n sort_order\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n unit_price\n \n as \n \n unit_price\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n HasQuantitySchedule\n \n , \n cast(null as boolean) as \n \n HasRevenueSchedule\n \n , \n cast(null as boolean) as \n \n HasSchedule\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as float) as \n \n ListPrice\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n PricebookEntryId\n \n , \n cast(null as TEXT) as \n \n Product2Id\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as timestamp) as \n \n ServiceDate\n \n , \n cast(null as integer) as \n \n SortOrder\n \n , \n cast(null as float) as \n \n TotalPrice\n \n , \n cast(null as float) as \n \n UnitPrice\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_opportunity_line_item_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as opportunity_line_item_id,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as opportunity_line_item_description,\n \n\n\n cast(Discount as float) as discount,\n \n\n\n coalesce(cast(HasQuantitySchedule as boolean),\n cast(has_quantity_schedule as boolean))\n as has_quantity_schedule,\n \n\n\n coalesce(cast(HasRevenueSchedule as boolean),\n cast(has_revenue_schedule as boolean))\n as has_revenue_schedule,\n \n\n\n coalesce(cast(HasSchedule as boolean),\n cast(has_schedule as boolean))\n as has_schedule,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(ListPrice as numeric(28,6)),\n cast(list_price as numeric(28,6)))\n as list_price,\n \n\n\n cast(Name as TEXT) as opportunity_line_item_name,\n \n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n coalesce(cast(PricebookEntryId as TEXT),\n cast(pricebook_entry_id as TEXT))\n as pricebook_entry_id,\n \n\n\n coalesce(cast(Product2Id as TEXT),\n cast(product_2_id as TEXT))\n as product_2_id,\n \n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n cast(Quantity as float) as quantity,\n \n\n\n coalesce(cast(ServiceDate as timestamp),\n cast(service_date as timestamp))\n as service_date,\n \n\n\n coalesce(cast(SortOrder as integer),\n cast(sort_order as integer))\n as sort_order,\n \n\n\n coalesce(cast(TotalPrice as numeric(28,6)),\n cast(total_price as numeric(28,6)))\n as total_price,\n \n\n\n coalesce(cast(UnitPrice as numeric(28,6)),\n cast(unit_price as numeric(28,6)))\n as unit_price\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.355308Z", "completed_at": "2024-07-10T00:47:39.360929Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.361576Z", "completed_at": "2024-07-10T00:47:39.361580Z"}], "thread_id": "Thread-5", "execution_time": 0.008058786392211914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n contact_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\n group by contact_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.365920Z", "completed_at": "2024-07-10T00:47:39.369605Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.369912Z", "completed_at": "2024-07-10T00:47:39.369917Z"}], "thread_id": "Thread-5", "execution_time": 0.0046269893646240234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.362470Z", "completed_at": "2024-07-10T00:47:39.370586Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.371104Z", "completed_at": "2024-07-10T00:47:39.371107Z"}], "thread_id": "Thread-2", "execution_time": 0.009852886199951172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\nwhere account_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.760916Z", "completed_at": "2024-07-10T00:47:39.310926Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.311203Z", "completed_at": "2024-07-10T00:47:39.311210Z"}], "thread_id": "Thread-1", "execution_time": 0.616206169128418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__user_role", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__user_role_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n developer_name\n \n as \n \n developer_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_access_for_account_owner\n \n as \n \n opportunity_access_for_account_owner\n \n, \n \n \n parent_role_id\n \n as \n \n parent_role_id\n \n, \n \n \n rollup_description\n \n as \n \n rollup_description\n \n, \n cast(null as TEXT) as \n \n DeveloperName\n \n , \n cast(null as TEXT) as \n \n OpportunityAccessForAccountOwner\n \n , \n cast(null as TEXT) as \n \n ParentRoleId\n \n , \n cast(null as TEXT) as \n \n RollupDescription\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_role_data\"\n), \n\nfinal as (\n\n select\n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(DeveloperName as TEXT),\n cast(developer_name as TEXT))\n as developer_name,\n \n\n\n cast(Id as TEXT) as user_role_id,\n \n\n\n cast(Name as TEXT) as user_role_name,\n \n\n\n coalesce(cast(OpportunityAccessForAccountOwner as TEXT),\n cast(opportunity_access_for_account_owner as TEXT))\n as opportunity_access_for_account_owner,\n \n\n\n coalesce(cast(ParentRoleId as TEXT),\n cast(parent_role_id as TEXT))\n as parent_role_id,\n \n\n\n coalesce(cast(RollupDescription as TEXT),\n cast(rollup_description as TEXT))\n as rollup_description\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.371981Z", "completed_at": "2024-07-10T00:47:39.379799Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.380438Z", "completed_at": "2024-07-10T00:47:39.380444Z"}], "thread_id": "Thread-5", "execution_time": 0.009661197662353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\"\nwhere event_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.376380Z", "completed_at": "2024-07-10T00:47:39.381257Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.384908Z", "completed_at": "2024-07-10T00:47:39.384914Z"}], "thread_id": "Thread-2", "execution_time": 0.00968027114868164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\nwhere account_id is not null\ngroup by account_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.381870Z", "completed_at": "2024-07-10T00:47:39.389354Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.393164Z", "completed_at": "2024-07-10T00:47:39.393170Z"}], "thread_id": "Thread-1", "execution_time": 0.013130903244018555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.386293Z", "completed_at": "2024-07-10T00:47:39.394223Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.394841Z", "completed_at": "2024-07-10T00:47:39.394845Z"}], "thread_id": "Thread-5", "execution_time": 0.009603261947631836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9", "compiled": true, "compiled_code": "\n \n \n\nselect\n event_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\"\nwhere event_id is not null\ngroup by event_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.389602Z", "completed_at": "2024-07-10T00:47:39.394638Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.397974Z", "completed_at": "2024-07-10T00:47:39.397980Z"}], "thread_id": "Thread-2", "execution_time": 0.012000083923339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.395182Z", "completed_at": "2024-07-10T00:47:39.399941Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.406363Z", "completed_at": "2024-07-10T00:47:39.406371Z"}], "thread_id": "Thread-1", "execution_time": 0.012495756149291992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.400137Z", "completed_at": "2024-07-10T00:47:39.410859Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.411446Z", "completed_at": "2024-07-10T00:47:39.411453Z"}], "thread_id": "Thread-5", "execution_time": 0.01256704330444336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"\nwhere contact_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.403324Z", "completed_at": "2024-07-10T00:47:39.411172Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.411898Z", "completed_at": "2024-07-10T00:47:39.411901Z"}], "thread_id": "Thread-2", "execution_time": 0.012701988220214844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.407974Z", "completed_at": "2024-07-10T00:47:39.412902Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.413632Z", "completed_at": "2024-07-10T00:47:39.413637Z"}], "thread_id": "Thread-1", "execution_time": 0.006417751312255859, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lead_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\nwhere lead_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.736558Z", "completed_at": "2024-07-10T00:47:39.354795Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.359332Z", "completed_at": "2024-07-10T00:47:39.359338Z"}], "thread_id": "Thread-4", "execution_time": 0.6918787956237793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__user", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n alias\n \n as \n \n alias\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company_name\n \n as \n \n company_name\n \n, \n \n \n contact_id\n \n as \n \n contact_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n last_login_date\n \n as \n \n last_login_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n manager_id\n \n as \n \n manager_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n profile_id\n \n as \n \n profile_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n user_role_id\n \n as \n \n user_role_id\n \n, \n \n \n user_type\n \n as \n \n user_type\n \n, \n \n \n username\n \n as \n \n username\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CompanyName\n \n , \n cast(null as TEXT) as \n \n ContactId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as timestamp) as \n \n LastLoginDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n ManagerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n ProfileId\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n , \n cast(null as TEXT) as \n \n UserRoleId\n \n , \n cast(null as TEXT) as \n \n UserType\n \n \n\n\n\n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_user_data\"\n), \n\nfinal as (\n \n select \n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n cast(Alias as TEXT) as alias,\n \n\n\n cast(City as TEXT) as city,\n \n\n\n coalesce(cast(CompanyName as TEXT),\n cast(company_name as TEXT))\n as company_name,\n \n\n\n coalesce(cast(ContactId as TEXT),\n cast(contact_id as TEXT))\n as contact_id,\n \n\n\n cast(Country as TEXT) as country,\n \n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n cast(Department as TEXT) as department,\n \n\n\n cast(Email as TEXT) as email,\n \n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n cast(Id as TEXT) as user_id,\n \n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n coalesce(cast(LastLoginDate as timestamp),\n cast(last_login_date as timestamp))\n as last_login_date,\n \n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(ManagerId as TEXT),\n cast(manager_id as TEXT))\n as manager_id,\n \n\n\n cast(Name as TEXT) as user_name,\n \n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n coalesce(cast(ProfileId as TEXT),\n cast(profile_id as TEXT))\n as profile_id,\n \n\n\n cast(State as TEXT) as state,\n \n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n cast(Street as TEXT) as street,\n \n\n\n cast(Title as TEXT) as title,\n \n\n\n coalesce(cast(UserRoleId as TEXT),\n cast(user_role_id as TEXT))\n as user_role_id,\n \n\n\n coalesce(cast(UserType as TEXT),\n cast(user_type as TEXT))\n as user_type,\n \n\n\n cast(Username as TEXT) as username\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect * \nfrom final", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.414694Z", "completed_at": "2024-07-10T00:47:39.430422Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.435012Z", "completed_at": "2024-07-10T00:47:39.435020Z"}], "thread_id": "Thread-5", "execution_time": 0.021996021270751953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282", "compiled": true, "compiled_code": "\n \n \n\nselect\n lead_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\nwhere lead_id is not null\ngroup by lead_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.676798Z", "completed_at": "2024-07-10T00:47:39.358878Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.360216Z", "completed_at": "2024-07-10T00:47:39.360220Z"}], "thread_id": "Thread-8", "execution_time": 0.7609479427337646, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__task", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__task_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n call_disposition\n \n as \n \n call_disposition\n \n, \n \n \n call_duration_in_seconds\n \n as \n \n call_duration_in_seconds\n \n, \n \n \n call_object\n \n as \n \n call_object\n \n, \n \n \n call_type\n \n as \n \n call_type\n \n, \n \n \n completed_date_time\n \n as \n \n completed_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_high_priority\n \n as \n \n is_high_priority\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n priority\n \n as \n \n priority\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n task_subtype\n \n as \n \n task_subtype\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as TEXT) as \n \n CallDisposition\n \n , \n cast(null as integer) as \n \n CallDurationInSeconds\n \n , \n cast(null as TEXT) as \n \n CallObject\n \n , \n cast(null as TEXT) as \n \n CallType\n \n , \n cast(null as timestamp) as \n \n CompletedDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsHighPriority\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n TaskSubtype\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_task_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as task_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n coalesce(cast(CallDisposition as TEXT),\n cast(call_disposition as TEXT))\n as call_disposition,\n \n\n\n coalesce(cast(CallDurationInSeconds as integer),\n cast(call_duration_in_seconds as integer))\n as call_duration_in_seconds,\n \n\n\n coalesce(cast(CallObject as TEXT),\n cast(call_object as TEXT))\n as call_object,\n \n\n\n coalesce(cast(CallType as TEXT),\n cast(call_type as TEXT))\n as call_type,\n \n\n\n coalesce(cast(CompletedDateTime as timestamp),\n cast(completed_date_time as timestamp))\n as completed_date_time,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as task_description,\n \n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(IsHighPriority as boolean),\n cast(is_high_priority as boolean))\n as is_high_priority,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n cast(Priority as TEXT) as priority,\n \n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n cast(Status as TEXT) as status,\n \n\n\n cast(Subject as TEXT) as subject,\n \n\n\n coalesce(cast(TaskSubtype as TEXT),\n cast(task_subtype as TEXT))\n as task_subtype,\n \n\n\n cast(Type as TEXT) as type,\n \n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.605633Z", "completed_at": "2024-07-10T00:47:39.359087Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.360428Z", "completed_at": "2024-07-10T00:47:39.360431Z"}], "thread_id": "Thread-6", "execution_time": 0.8316590785980225, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__order", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__order_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activated_by_id\n \n as \n \n activated_by_id\n \n, \n \n \n activated_date\n \n as \n \n activated_date\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_country_code\n \n as \n \n billing_country_code\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n contract_id\n \n as \n \n contract_id\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n original_order_id\n \n as \n \n original_order_id\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n pricebook_2_id\n \n as \n \n pricebook_2_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n total_amount\n \n as \n \n total_amount\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n ActivatedById\n \n , \n cast(null as timestamp) as \n \n ActivatedDate\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingCountryCode\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as TEXT) as \n \n ContractId\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n OrderNumber\n \n , \n cast(null as TEXT) as \n \n OriginalOrderId\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n Pricebook2Id\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n , \n cast(null as float) as \n \n TotalAmount\n \n \n\n\n \n from \"postgres\".\"zz_dbt_catherine_sf\".\"sf_order_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n cast(Id as TEXT) as order_id,\n \n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n coalesce(cast(ActivatedById as TEXT),\n cast(activated_by_id as TEXT))\n as activated_by_id,\n \n\n\n coalesce(cast(ActivatedDate as timestamp),\n cast(activated_date as timestamp))\n as activated_date,\n \n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n coalesce(cast(BillingCountryCode as TEXT),\n cast(billing_country_code as TEXT))\n as billing_country_code,\n \n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n coalesce(cast(ContractId as TEXT),\n cast(contract_id as TEXT))\n as contract_id,\n \n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n cast(Description as TEXT) as order_description,\n \n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n coalesce(cast(OrderNumber as TEXT),\n cast(order_number as TEXT))\n as order_number,\n \n\n\n coalesce(cast(OriginalOrderId as TEXT),\n cast(original_order_id as TEXT))\n as original_order_id,\n \n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n coalesce(cast(Pricebook2Id as TEXT),\n cast(pricebook_2_id as TEXT))\n as pricebook_2_id,\n \n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n cast(Status as TEXT) as status,\n \n\n\n coalesce(cast(TotalAmount as numeric(28,6)),\n cast(total_amount as numeric(28,6)))\n as total_amount,\n \n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__order\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.430829Z", "completed_at": "2024-07-10T00:47:39.437435Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.439124Z", "completed_at": "2024-07-10T00:47:39.439128Z"}], "thread_id": "Thread-1", "execution_time": 0.012738943099975586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n opportunity_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\n group by opportunity_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.439902Z", "completed_at": "2024-07-10T00:47:39.488342Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.491696Z", "completed_at": "2024-07-10T00:47:39.491704Z"}], "thread_id": "Thread-4", "execution_time": 0.05520486831665039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.488579Z", "completed_at": "2024-07-10T00:47:39.498731Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.499773Z", "completed_at": "2024-07-10T00:47:39.499779Z"}], "thread_id": "Thread-6", "execution_time": 0.05685997009277344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61", "compiled": true, "compiled_code": "\n \n \n\nselect\n product_2_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"\nwhere product_2_id is not null\ngroup by product_2_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.444331Z", "completed_at": "2024-07-10T00:47:39.498984Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.500177Z", "completed_at": "2024-07-10T00:47:39.500180Z"}], "thread_id": "Thread-5", "execution_time": 0.06137895584106445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.448147Z", "completed_at": "2024-07-10T00:47:39.499171Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.500565Z", "completed_at": "2024-07-10T00:47:39.500569Z"}], "thread_id": "Thread-8", "execution_time": 0.06105685234069824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect product_2_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"\nwhere product_2_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.492279Z", "completed_at": "2024-07-10T00:47:39.501149Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.505331Z", "completed_at": "2024-07-10T00:47:39.505340Z"}], "thread_id": "Thread-1", "execution_time": 0.057562828063964844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__opportunity_line_item_enhanced", "compiled": true, "compiled_code": "--This model will only run if you have the underlying opportunity line item table.\n\nwith opportunity_line_item as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"\n),\n\n-- If using product_2 table, the following will be included, otherwise it will not.\n\nproduct_2 as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__product_2\"\n),\n\n\n\nfinal as (\n\n select\n oli.opportunity_line_item_id,\n oli.opportunity_line_item_name,\n oli.opportunity_line_item_description,\n oli.opportunity_id,\n row_number() over (partition by oli.opportunity_id order by oli.created_date) as line_item_index,\n count(opportunity_line_item_id) over (partition by oli.opportunity_id) as total_line_items,\n oli.created_date,\n oli.last_modified_date,\n oli.service_date,\n oli.pricebook_entry_id,\n oli.product_2_id,\n oli.list_price,\n oli.quantity,\n oli.unit_price,\n oli.total_price,\n oli.has_quantity_schedule,\n oli.has_revenue_schedule\n\n \n ,\n product_2.product_2_name,\n product_2.product_code,\n product_2.product_2_description,\n product_2.external_id as product_external_id,\n product_2.family as product_family,\n product_2.is_active as product_is_active,\n product_2.is_archived as product_is_archived,\n product_2.is_deleted as product_is_deleted,\n product_2.number_of_quantity_installments as product_number_of_quantity_installments,\n product_2.quantity_installment_period as product_quantity_installment_period,\n product_2.quantity_schedule_type as product_quantity_schedule_type,\n product_2.quantity_unit_of_measure as product_quantity_unit_of_measure,\n product_2.number_of_revenue_installments as product_number_of_revenue_installments,\n product_2.revenue_installment_period as product_revenue_installment_period,\n product_2.revenue_schedule_type as product_revenue_schedule_type\n \n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n \n \n\n\n\n\n \n\n from opportunity_line_item as oli\n\n \n left join product_2\n on oli.product_2_id = product_2.product_2_id\n \n)\n\nselect * \nfrom final", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:38.811753Z", "completed_at": "2024-07-10T00:47:39.435819Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.437695Z", "completed_at": "2024-07-10T00:47:39.437700Z"}], "thread_id": "Thread-7", "execution_time": 0.6960318088531494, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__account_daily_history", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1652\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-10'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\naccount_history as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, account_id\n order by _fivetran_start desc) as row_num \n from account_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.account_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as account_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_history", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__account_daily_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.502133Z", "completed_at": "2024-07-10T00:47:39.507861Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.515175Z", "completed_at": "2024-07-10T00:47:39.515180Z"}], "thread_id": "Thread-4", "execution_time": 0.01582503318786621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.508457Z", "completed_at": "2024-07-10T00:47:39.522720Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.523828Z", "completed_at": "2024-07-10T00:47:39.523833Z"}], "thread_id": "Thread-6", "execution_time": 0.01795196533203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.511714Z", "completed_at": "2024-07-10T00:47:39.523126Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.531594Z", "completed_at": "2024-07-10T00:47:39.531598Z"}], "thread_id": "Thread-5", "execution_time": 0.025470972061157227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_role_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\nwhere user_role_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.515546Z", "completed_at": "2024-07-10T00:47:39.523634Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.532221Z", "completed_at": "2024-07-10T00:47:39.532224Z"}], "thread_id": "Thread-8", "execution_time": 0.02584099769592285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_role_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\nwhere user_role_id is not null\ngroup by user_role_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.518959Z", "completed_at": "2024-07-10T00:47:39.530476Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.532843Z", "completed_at": "2024-07-10T00:47:39.532846Z"}], "thread_id": "Thread-1", "execution_time": 0.02466893196105957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__contact_enhanced", "compiled": true, "compiled_code": "with contact as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact\"\n), \n\naccount as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n)\n\nselect \n contact.contact_id,\n contact.contact_name,\n contact.account_id,\n contact.department,\n contact.contact_description,\n contact.email,\n contact.individual_id,\n contact.is_deleted as contact_is_deleted,\n contact.last_activity_date,\n contact.lead_source,\n contact.mailing_city,\n contact.mailing_country,\n contact.mailing_country_code,\n contact.mailing_postal_code,\n contact.mailing_state,\n contact.mailing_state_code,\n contact.mailing_street,\n contact.master_record_id,\n contact.mobile_phone,\n contact.owner_id as contact_owner_id,\n contact.phone,\n contact.reports_to_id,\n salesforce_user.user_name as contact_owner_name,\n account.account_name,\n account.account_number,\n account.account_source,\n account.annual_revenue as account_annual_revenue,\n account.account_description,\n account.industry as account_industry,\n account.is_deleted as account_is_deleted,\n account.number_of_employees as account_number_of_employees,\n account.owner_id as account_owner_id,\n account.parent_id as account_parent_id,\n account.rating as account_rating,\n account.type as account_type\n\n --The below scripts allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\nfrom contact\nleft join account \n on contact.account_id = account.account_id\nleft join salesforce_user\n on contact.owner_id = salesforce_user.user_id", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_enhanced\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.524212Z", "completed_at": "2024-07-10T00:47:39.537325Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.538535Z", "completed_at": "2024-07-10T00:47:39.538540Z"}], "thread_id": "Thread-7", "execution_time": 0.0203249454498291, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__opportunity_enhanced", "compiled": true, "compiled_code": "with opportunity as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\n), \n\n\naccount as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__account\"\n), \n\nadd_fields as (\n\n select \n opportunity.*,\n account.account_number,\n account.account_source,\n account.industry,\n account.account_name,\n account.number_of_employees,\n account.type as account_type,\n opportunity_owner.user_id as opportunity_owner_id,\n opportunity_owner.user_name as opportunity_owner_name,\n opportunity_owner.user_role_id as opportunity_owner_role_id,\n opportunity_owner.city opportunity_owner_city,\n opportunity_owner.state as opportunity_owner_state,\n opportunity_manager.user_id as opportunity_manager_id,\n opportunity_manager.user_name as opportunity_manager_name,\n opportunity_manager.city opportunity_manager_city,\n opportunity_manager.state as opportunity_manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as opportunity_owner_position, \n user_role.developer_name as opportunity_owner_developer_name,\n user_role.parent_role_id as opportunity_owner_parent_role_id,\n user_role.rollup_description as opportunity_owner_rollup_description,\n \n\n case\n when opportunity.is_won then 'Won'\n when not opportunity.is_won and opportunity.is_closed then 'Lost'\n when not opportunity.is_closed and lower(opportunity.forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status,\n case when is_created_this_month then amount else 0 end as created_amount_this_month,\n case when is_created_this_quarter then amount else 0 end as created_amount_this_quarter,\n case when is_created_this_month then 1 else 0 end as created_count_this_month,\n case when is_created_this_quarter then 1 else 0 end as created_count_this_quarter,\n case when is_closed_this_month then amount else 0 end as closed_amount_this_month,\n case when is_closed_this_quarter then amount else 0 end as closed_amount_this_quarter,\n case when is_closed_this_month then 1 else 0 end as closed_count_this_month,\n case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter\n\n --The below script allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n \n\n\n\n\n \n\n from opportunity\n left join account \n on opportunity.account_id = account.account_id\n left join salesforce_user as opportunity_owner \n on opportunity.owner_id = opportunity_owner.user_id\n left join salesforce_user as opportunity_manager \n on opportunity_owner.manager_id = opportunity_manager.user_id\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n left join user_role \n on opportunity_owner.user_role_id = user_role.user_role_id\n \n)\n\nselect *\nfrom add_fields", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.533494Z", "completed_at": "2024-07-10T00:47:39.538858Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.542513Z", "completed_at": "2024-07-10T00:47:39.542517Z"}], "thread_id": "Thread-4", "execution_time": 0.01922917366027832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\nwhere user_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.539609Z", "completed_at": "2024-07-10T00:47:39.556940Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.557845Z", "completed_at": "2024-07-10T00:47:39.557852Z"}], "thread_id": "Thread-6", "execution_time": 0.02082514762878418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.543064Z", "completed_at": "2024-07-10T00:47:39.558231Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.562795Z", "completed_at": "2024-07-10T00:47:39.562798Z"}], "thread_id": "Thread-5", "execution_time": 0.025120019912719727, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__daily_activity", "compiled": true, "compiled_code": "with date_spine as (\n \n select \n date_trunc('day', date_day) as date_day\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__date_spine\"\n),\n\n\ntask as (\n \n select \n date_trunc('day', activity_date) as activity_date,\n count(task_id) as tasks_completed\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"\n group by 1\n), \n\n\n\nsalesforce_event as (\n\n select \n coalesce(date_trunc('day', activity_date), date_trunc('day', activity_date_time)) as activity_date,\n count(event_id) as events_completed\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__event\"\n group by 1\n), \n\n\n\nsalesforce_lead as (\n\n select \n date_trunc('day', created_date) as created_date,\n count(lead_id) as leads_created \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\n group by 1\n), \n\nsalesforce_converted_lead as (\n\n select \n date_trunc('day', converted_date) as converted_date,\n count(lead_id) as leads_converted\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__lead\"\n where is_converted\n group by 1\n), \n\n\nopportunity as (\n\n select \n opportunity_id,\n date_trunc('day', created_date) as created_date,\n account_id,\n date_trunc('day', close_date) as close_date,\n is_closed,\n is_deleted,\n is_won,\n owner_id, \n stage_name,\n type,\n amount,\n case\n when is_won then 'Won'\n when not is_won and is_closed then 'Lost'\n when not is_closed and lower(forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity\"\n),\n\nopportunities_created as (\n\n select\n created_date,\n count(opportunity_id) as opportunities_created,\n round(sum(amount)) as opportunities_created_amount\n from opportunity\n group by 1\n),\n\nopportunities_closed as (\n\n select\n close_date,\n count(case when status = 'Won' then opportunity_id else null end) as opportunities_won,\n round(sum(case when status = 'Won' then amount else 0 end)) as opportunities_won_amount,\n count(case when status = 'Lost' then opportunity_id else null end) as opportunities_lost,\n round(sum(case when status = 'Lost' then amount else null end)) as opportunities_lost_amount,\n round(sum(case when status = 'Pipeline' then amount else null end)) as pipeline_amount\n from opportunity\n group by 1\n)\n\nselect\n date_spine.date_day,\n\n \n salesforce_lead.leads_created,\n salesforce_converted_lead.leads_converted,\n \n \n \n task.tasks_completed,\n \n\n \n salesforce_event.events_completed,\n \n\n opportunities_created.opportunities_created,\n opportunities_created.opportunities_created_amount,\n opportunities_closed.opportunities_won,\n opportunities_closed.opportunities_won_amount,\n opportunities_closed.opportunities_lost,\n opportunities_closed.opportunities_lost_amount,\n opportunities_closed.pipeline_amount\nfrom date_spine\n\n\nleft join salesforce_lead\n on date_spine.date_day = salesforce_lead.created_date\nleft join salesforce_converted_lead\n on date_spine.date_day = salesforce_converted_lead.converted_date\n\n\n\nleft join task\n on date_spine.date_day = task.activity_date\n\n\n\nleft join salesforce_event\n on date_spine.date_day = salesforce_event.activity_date\n\n\nleft join opportunities_created\n on date_spine.date_day = opportunities_created.created_date\nleft join opportunities_closed\n on date_spine.date_day = opportunities_closed.close_date", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__daily_activity\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.549356Z", "completed_at": "2024-07-10T00:47:39.561946Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.563189Z", "completed_at": "2024-07-10T00:47:39.563192Z"}], "thread_id": "Thread-8", "execution_time": 0.02517390251159668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"\nwhere task_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.554205Z", "completed_at": "2024-07-10T00:47:39.562146Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.563570Z", "completed_at": "2024-07-10T00:47:39.563573Z"}], "thread_id": "Thread-1", "execution_time": 0.0245819091796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605", "compiled": true, "compiled_code": "\n \n \n\nselect\n task_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__task\"\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.558459Z", "completed_at": "2024-07-10T00:47:39.566686Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.567949Z", "completed_at": "2024-07-10T00:47:39.567953Z"}], "thread_id": "Thread-7", "execution_time": 0.014405965805053711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__order\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.563916Z", "completed_at": "2024-07-10T00:47:39.568730Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.572554Z", "completed_at": "2024-07-10T00:47:39.572558Z"}], "thread_id": "Thread-4", "execution_time": 0.01512002944946289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__order\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.569149Z", "completed_at": "2024-07-10T00:47:39.582532Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.585903Z", "completed_at": "2024-07-10T00:47:39.585908Z"}], "thread_id": "Thread-6", "execution_time": 0.01954197883605957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.573378Z", "completed_at": "2024-07-10T00:47:39.585664Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.586923Z", "completed_at": "2024-07-10T00:47:39.586927Z"}], "thread_id": "Thread-5", "execution_time": 0.018685102462768555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.576075Z", "completed_at": "2024-07-10T00:47:39.586309Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.587577Z", "completed_at": "2024-07-10T00:47:39.587580Z"}], "thread_id": "Thread-8", "execution_time": 0.01911187171936035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_day_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.578872Z", "completed_at": "2024-07-10T00:47:39.586493Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.588130Z", "completed_at": "2024-07-10T00:47:39.588133Z"}], "thread_id": "Thread-1", "execution_time": 0.019269704818725586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is not null\ngroup by account_day_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.583084Z", "completed_at": "2024-07-10T00:47:39.587932Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.591791Z", "completed_at": "2024-07-10T00:47:39.591795Z"}], "thread_id": "Thread-7", "execution_time": 0.01870894432067871, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.588472Z", "completed_at": "2024-07-10T00:47:39.593129Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.596744Z", "completed_at": "2024-07-10T00:47:39.596749Z"}], "thread_id": "Thread-4", "execution_time": 0.014030694961547852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.593971Z", "completed_at": "2024-07-10T00:47:39.605965Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.609291Z", "completed_at": "2024-07-10T00:47:39.609296Z"}], "thread_id": "Thread-6", "execution_time": 0.018078088760375977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\nsalesforce_user as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n), \n\nbooking_by_owner as (\n\n select \n opportunity_manager_id as b_manager_id,\n opportunity_owner_id as b_owner_id,\n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n group by 1, 2\n), \n\nlost_by_owner as (\n\n select \n opportunity_manager_id as l_manager_id,\n opportunity_owner_id as l_owner_id,\n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n group by 1, 2\n), \n\npipeline_by_owner as (\n\n select \n opportunity_manager_id as p_manager_id,\n opportunity_owner_id as p_owner_id,\n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n group by 1, 2\n)\n\nselect \n salesforce_user.user_id as owner_id,\n coalesce(p_manager_id, b_manager_id, l_manager_id) as manager_id,\n booking_by_owner.*,\n lost_by_owner.*,\n pipeline_by_owner.*\nfrom salesforce_user\nleft join booking_by_owner \n on booking_by_owner.b_owner_id = salesforce_user.user_id\nleft join lost_by_owner \n on lost_by_owner.l_owner_id = salesforce_user.user_id\nleft join pipeline_by_owner \n on pipeline_by_owner.p_owner_id = salesforce_user.user_id", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.597517Z", "completed_at": "2024-07-10T00:47:39.608992Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.610159Z", "completed_at": "2024-07-10T00:47:39.610162Z"}], "thread_id": "Thread-5", "execution_time": 0.017763853073120117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__sales_snapshot", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\npipeline as (\n\n select \n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n), \n\nbookings as (\n\n select \n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n), \n\nlost as (\n\n select \n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n)\n\nselect \n bookings.*,\n pipeline.*,\n lost.*,\n case \n when (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) = 0 then null\n else round( (bookings.bookings_amount_closed_this_month / (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) ) * 100, 2 )\n end as win_percent_this_month,\n case \n when (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) = 0 then null\n else round( (bookings.bookings_amount_closed_this_quarter / (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) ) * 100, 2 ) \n end as win_percent_this_quarter,\n case \n when (bookings.total_bookings_amount + lost.total_lost_amount) = 0 then null \n else round( (bookings.total_bookings_amount / (bookings.total_bookings_amount + lost.total_lost_amount) ) * 100, 2) \n end as total_win_percent\nfrom bookings, pipeline, lost", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__sales_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.599645Z", "completed_at": "2024-07-10T00:47:39.609668Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.610834Z", "completed_at": "2024-07-10T00:47:39.610838Z"}], "thread_id": "Thread-8", "execution_time": 0.017982959747314453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.603381Z", "completed_at": "2024-07-10T00:47:39.610489Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.614487Z", "completed_at": "2024-07-10T00:47:39.614491Z"}], "thread_id": "Thread-1", "execution_time": 0.02099132537841797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.606458Z", "completed_at": "2024-07-10T00:47:39.614282Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.615374Z", "completed_at": "2024-07-10T00:47:39.615377Z"}], "thread_id": "Thread-7", "execution_time": 0.018334150314331055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.611444Z", "completed_at": "2024-07-10T00:47:39.615996Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.620133Z", "completed_at": "2024-07-10T00:47:39.620138Z"}], "thread_id": "Thread-4", "execution_time": 0.014026165008544922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.616442Z", "completed_at": "2024-07-10T00:47:39.623986Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.624393Z", "completed_at": "2024-07-10T00:47:39.624396Z"}], "thread_id": "Thread-6", "execution_time": 0.009564876556396484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__manager_performance", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user_role\"\n),\n\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n)\n\nselect \n coalesce(manager.user_id, 'No Manager Assigned') as manager_id,\n coalesce(manager.user_name, 'No Manager Assigned') as manager_name,\n manager.city as manager_city,\n manager.state as manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as manager_position,\n \n\n count(distinct owner_id) as number_of_direct_reports,\n coalesce(sum(bookings_amount_closed_this_month), 0) as bookings_amount_closed_this_month,\n coalesce(sum(bookings_amount_closed_this_quarter), 0) as bookings_amount_closed_this_quarter,\n coalesce(sum(total_number_bookings), 0) as total_number_bookings,\n coalesce(sum(total_bookings_amount), 0) as total_bookings_amount,\n coalesce(sum(bookings_count_closed_this_month), 0) as bookings_count_closed_this_month,\n coalesce(sum(bookings_count_closed_this_quarter), 0) as bookings_count_closed_this_quarter,\n coalesce(max(largest_booking), 0) as largest_booking,\n coalesce(sum(lost_amount_this_month), 0) as lost_amount_this_month,\n coalesce(sum(lost_amount_this_quarter), 0) as lost_amount_this_quarter,\n coalesce(sum(total_number_lost), 0) as total_number_lost,\n coalesce(sum(total_lost_amount), 0) as total_lost_amount,\n coalesce(sum(lost_count_this_month), 0) as lost_count_this_month,\n coalesce(sum(lost_count_this_quarter), 0) as lost_count_this_quarter,\n coalesce(sum(pipeline_created_amount_this_month), 0) as pipeline_created_amount_this_month,\n coalesce(sum(pipeline_created_amount_this_quarter), 0) as pipeline_created_amount_this_quarter,\n coalesce(sum(pipeline_created_forecast_amount_this_month), 0) as pipeline_created_forecast_amount_this_month,\n coalesce(sum(pipeline_created_forecast_amount_this_quarter), 0) as pipeline_created_forecast_amount_this_quarter,\n coalesce(sum(pipeline_count_created_this_month), 0) as pipeline_count_created_this_month,\n coalesce(sum(pipeline_count_created_this_quarter), 0) as pipeline_count_created_this_quarter,\n coalesce(sum(total_number_pipeline), 0) as total_number_pipeline,\n coalesce(sum(total_pipeline_amount), 0) as total_pipeline_amount,\n coalesce(sum(total_pipeline_forecast_amount), 0) as total_pipeline_forecast_amount,\n coalesce(max(largest_deal_in_pipeline), 0) as largest_deal_in_pipeline,\n round(case \n when sum(bookings_amount_closed_this_month + lost_amount_this_month) > 0 then\n sum(bookings_amount_closed_this_month) / sum(bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0\n end, 2) as win_percent_this_month,\n round(case\n when sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 then\n sum(bookings_amount_closed_this_quarter) / sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0\n end, 2) as win_percent_this_quarter,\n round(case\n when sum(total_bookings_amount + total_lost_amount) > 0 then\n sum(total_bookings_amount) / sum(total_bookings_amount + total_lost_amount) * 100\n else 0\n end, 2) as total_win_percent\n\nfrom opportunity_aggregation_by_owner\nleft join salesforce_user as manager\n on manager.user_id = opportunity_aggregation_by_owner.manager_id\n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nleft join user_role\n on manager.user_role_id = user_role.user_role_id\n\ngroup by 1, 2, 3, 4, 5\n\n\n\nhaving count(distinct owner_id) > 0", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__manager_performance\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.620515Z", "completed_at": "2024-07-10T00:47:39.624202Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.624753Z", "completed_at": "2024-07-10T00:47:39.624756Z"}], "thread_id": "Thread-5", "execution_time": 0.009650945663452148, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__owner_performance", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\" \n), \n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__user\"\n)\n\nselect \n opportunity_aggregation_by_owner.*,\n salesforce_user.user_name as owner_name,\n salesforce_user.city as owner_city,\n salesforce_user.state as owner_state,\n case \n when (bookings_amount_closed_this_month + lost_amount_this_month) > 0 \n then bookings_amount_closed_this_month / (bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0 \n end as win_percent_this_month,\n case \n when (bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 \n then bookings_amount_closed_this_quarter / (bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0 \n end as win_percent_this_quarter,\n case \n when (total_bookings_amount + total_lost_amount) > 0 \n then total_bookings_amount / (total_bookings_amount + total_lost_amount) * 100\n else 0 \n end as total_win_percent\nfrom opportunity_aggregation_by_owner\njoin salesforce_user \n on salesforce_user.user_id = opportunity_aggregation_by_owner.owner_id", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__owner_performance\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.630153Z", "completed_at": "2024-07-10T00:47:39.638364Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.638592Z", "completed_at": "2024-07-10T00:47:39.638600Z"}], "thread_id": "Thread-8", "execution_time": 0.012518882751464844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650", "compiled": true, "compiled_code": "\n \n \n\nselect\n manager_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is not null\ngroup by manager_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.627372Z", "completed_at": "2024-07-10T00:47:39.639046Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.639266Z", "completed_at": "2024-07-10T00:47:39.639269Z"}], "thread_id": "Thread-5", "execution_time": 0.013641119003295898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect manager_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.635618Z", "completed_at": "2024-07-10T00:47:39.639667Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.639871Z", "completed_at": "2024-07-10T00:47:39.639874Z"}], "thread_id": "Thread-4", "execution_time": 0.012764215469360352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7", "compiled": true, "compiled_code": "\n \n \n\nselect\n owner_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is not null\ngroup by owner_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.632906Z", "completed_at": "2024-07-10T00:47:39.640214Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.640449Z", "completed_at": "2024-07-10T00:47:39.640452Z"}], "thread_id": "Thread-7", "execution_time": 0.013756990432739258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect owner_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.226502Z", "completed_at": "2024-07-10T00:47:39.869776Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.870031Z", "completed_at": "2024-07-10T00:47:39.870037Z"}], "thread_id": "Thread-3", "execution_time": 0.6866652965545654, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__contact_daily_history", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1652\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-10'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncontact_history as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__contact_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, contact_id\n order by _fivetran_start desc) as row_num \n from contact_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.contact_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as contact_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_history", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_daily_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.915198Z", "completed_at": "2024-07-10T00:47:39.923280Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.923576Z", "completed_at": "2024-07-10T00:47:39.923584Z"}], "thread_id": "Thread-1", "execution_time": 0.009634017944335938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_day_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.919670Z", "completed_at": "2024-07-10T00:47:39.924975Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:39.925224Z", "completed_at": "2024-07-10T00:47:39.925227Z"}], "thread_id": "Thread-6", "execution_time": 0.010886907577514648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is not null\ngroup by contact_day_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:39.418943Z", "completed_at": "2024-07-10T00:47:40.032855Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:40.033205Z", "completed_at": "2024-07-10T00:47:40.033212Z"}], "thread_id": "Thread-2", "execution_time": 0.6692960262298584, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__opportunity_daily_history", "compiled": true, "compiled_code": "\n\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1652\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-10'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\nopportunity_history as (\n\n select * \n from \"postgres\".\"zz_dbt_catherine_sf\".\"stg_salesforce__opportunity_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, opportunity_id\n order by _fivetran_start desc) as row_num \n from opportunity_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.opportunity_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as opportunity_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_history", "relation_name": "\"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_daily_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:40.086627Z", "completed_at": "2024-07-10T00:47:40.097078Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:40.097738Z", "completed_at": "2024-07-10T00:47:40.097746Z"}], "thread_id": "Thread-5", "execution_time": 0.013013124465942383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_day_id\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-10T00:47:40.092480Z", "completed_at": "2024-07-10T00:47:40.097419Z"}, {"name": "execute", "started_at": "2024-07-10T00:47:40.098324Z", "completed_at": "2024-07-10T00:47:40.098330Z"}], "thread_id": "Thread-4", "execution_time": 0.01306915283203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_dbt_catherine_sf_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is not null\ngroup by opportunity_day_id\nhaving count(*) > 1\n\n\n", "relation_name": null}], "elapsed_time": 4.391434907913208, "args": {"log_format_file": "debug", "use_colors_file": true, "strict_mode": false, "compile": true, "introspect": true, "defer": false, "static_parser": true, "log_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests/logs", "use_colors": true, "macro_debugging": false, "project_dir": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "write_json": true, "partial_parse_file_diff": true, "exclude": [], "print": true, "populate_cache": true, "warn_error_options": {"include": [], "exclude": []}, "printer_width": 80, "log_file_max_bytes": 10485760, "quiet": false, "profiles_dir": "/Users/catherinefritz/.dbt", "log_level_file": "debug", "vars": {}, "indirect_selection": "eager", "cache_selected_only": false, "version_check": true, "partial_parse": true, "which": "generate", "require_explicit_package_overrides_for_builtin_materializations": true, "require_resource_names_without_spaces": false, "log_format": "default", "empty_catalog": false, "select": [], "enable_legacy_logger": false, "send_anonymous_usage_stats": true, "show_resource_report": false, "favor_state": false, "log_level": "info", "static": false, "invocation_command": "dbt docs generate", "source_freshness_run_project_hooks": false}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json", "dbt_version": "1.8.3", "generated_at": "2024-07-23T21:34:54.177848Z", "invocation_id": "8953cfeb-e6f4-47c1-be99-b3c6436f0b90", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:51.114447Z", "completed_at": "2024-07-23T21:34:51.917385Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:51.917692Z", "completed_at": "2024-07-23T21:34:51.917704Z"}], "thread_id": "Thread-8", "execution_time": 1.0095140933990479, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_history", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_salesforce\".\"sf_opportunity_history_data\"\n \n \n \n),\n\nfinal as (\n\n select \n id as opportunity_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"amount\",\n \"campaign_id\",\n \"close_date\",\n \"created_date\",\n \"description\",\n \"expected_revenue\",\n \"fiscal\",\n \"fiscal_quarter\",\n \"fiscal_year\",\n \"forecast_category\",\n \"forecast_category_name\",\n \"has_open_activity\",\n \"has_opportunity_line_item\",\n \"has_overdue_task\",\n \"is_closed\",\n \"is_deleted\",\n \"is_won\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"lead_source\",\n \"name\",\n \"next_step\",\n \"owner_id\",\n \"probability\",\n \"record_type_id\",\n \"stage_name\",\n \"synced_quote_id\",\n \"type\"\n from base\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:50.997555Z", "completed_at": "2024-07-23T21:34:51.918047Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:51.918382Z", "completed_at": "2024-07-23T21:34:51.918388Z"}], "thread_id": "Thread-2", "execution_time": 1.0649988651275635, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__account_history", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_salesforce\".\"sf_account_history_data\"\n \n \n \n),\n\nfinal as (\n\n select \n id as account_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_number\",\n \"account_source\",\n \"annual_revenue\",\n \"billing_city\",\n \"billing_country\",\n \"billing_postal_code\",\n \"billing_state\",\n \"billing_street\",\n \"description\",\n \"industry\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"master_record_id\",\n \"name\",\n \"number_of_employees\",\n \"owner_id\",\n \"ownership\",\n \"parent_id\",\n \"rating\",\n \"record_type_id\",\n \"shipping_city\",\n \"shipping_country\",\n \"shipping_postal_code\",\n \"shipping_state\",\n \"shipping_street\",\n \"type\",\n \"website\"\n from base\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:51.075340Z", "completed_at": "2024-07-23T21:34:52.082891Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.083147Z", "completed_at": "2024-07-23T21:34:52.083153Z"}], "thread_id": "Thread-6", "execution_time": 1.178938865661621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__lead", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__lead_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company\n \n as \n \n company\n \n, \n \n \n converted_account_id\n \n as \n \n converted_account_id\n \n, \n \n \n converted_contact_id\n \n as \n \n converted_contact_id\n \n, \n \n \n converted_date\n \n as \n \n converted_date\n \n, \n \n \n converted_opportunity_id\n \n as \n \n converted_opportunity_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n email_bounced_date\n \n as \n \n email_bounced_date\n \n, \n \n \n email_bounced_reason\n \n as \n \n email_bounced_reason\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n has_opted_out_of_email\n \n as \n \n has_opted_out_of_email\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_converted\n \n as \n \n is_converted\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_unread_by_owner\n \n as \n \n is_unread_by_owner\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n ConvertedAccountId\n \n , \n cast(null as TEXT) as \n \n ConvertedContactId\n \n , \n cast(null as timestamp) as \n \n ConvertedDate\n \n , \n cast(null as TEXT) as \n \n ConvertedOpportunityId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EmailBouncedDate\n \n , \n cast(null as TEXT) as \n \n EmailBouncedReason\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as boolean) as \n \n HasOptedOutOfEmail\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsConverted\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsUnreadByOwner\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_lead_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as lead_id,\n \n\n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n\n cast(City as TEXT) as city,\n \n\n\n\n cast(Company as TEXT) as company,\n \n\n\n\n coalesce(cast(ConvertedAccountId as TEXT),\n cast(converted_account_id as TEXT))\n as converted_account_id,\n \n\n\n\n coalesce(cast(ConvertedContactId as TEXT),\n cast(converted_contact_id as TEXT))\n as converted_contact_id,\n \n\n\n\n coalesce(cast(ConvertedDate as timestamp),\n cast(converted_date as timestamp))\n as converted_date,\n \n\n\n\n coalesce(cast(ConvertedOpportunityId as TEXT),\n cast(converted_opportunity_id as TEXT))\n as converted_opportunity_id,\n \n\n\n\n cast(Country as TEXT) as country,\n \n\n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as lead_description,\n \n\n\n\n cast(Email as TEXT) as email,\n \n\n\n\n coalesce(cast(EmailBouncedDate as timestamp),\n cast(email_bounced_date as timestamp))\n as email_bounced_date,\n \n\n\n\n coalesce(cast(EmailBouncedReason as TEXT),\n cast(email_bounced_reason as TEXT))\n as email_bounced_reason,\n \n\n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n\n coalesce(cast(HasOptedOutOfEmail as boolean),\n cast(has_opted_out_of_email as boolean))\n as has_opted_out_of_email,\n \n\n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n\n cast(Industry as TEXT) as industry,\n \n\n\n\n coalesce(cast(IsConverted as boolean),\n cast(is_converted as boolean))\n as is_converted,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsUnreadByOwner as boolean),\n cast(is_unread_by_owner as boolean))\n as is_unread_by_owner,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n\n cast(Name as TEXT) as lead_name,\n \n\n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Phone as TEXT) as phone,\n \n\n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n\n cast(State as TEXT) as state,\n \n\n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n\n cast(Status as TEXT) as status,\n \n\n\n\n cast(Street as TEXT) as street,\n \n\n\n\n cast(Title as TEXT) as title,\n \n\n\n\n cast(Website as TEXT) as website\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:51.038974Z", "completed_at": "2024-07-23T21:34:52.196713Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.197467Z", "completed_at": "2024-07-23T21:34:52.197474Z"}], "thread_id": "Thread-4", "execution_time": 1.3079898357391357, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__contact_history", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"zz_salesforce\".\"sf_contact_history_data\"\n \n \n \n),\n\nfinal as (\n\n select \n id as contact_id,\n cast(_fivetran_start as timestamp) as _fivetran_start,\n cast(_fivetran_end as timestamp) as _fivetran_end,\n cast(_fivetran_start as date) as _fivetran_date,\n md5(cast(coalesce(cast(id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_start as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as history_unique_key,\n\n \"_fivetran_active\",\n \"_fivetran_synced\",\n \"account_id\",\n \"email\",\n \"first_name\",\n \"is_deleted\",\n \"last_activity_date\",\n \"last_modified_by_id\",\n \"last_modified_date\",\n \"last_name\",\n \"last_referenced_date\",\n \"last_viewed_date\",\n \"mailing_city\",\n \"mailing_country\",\n \"mailing_country_code\",\n \"mailing_postal_code\",\n \"mailing_state\",\n \"mailing_street\",\n \"master_record_id\",\n \"mobile_phone\",\n \"name\",\n \"owner_id\",\n \"phone\",\n \"reports_to_id\",\n \"title\",\n \"lead_source\",\n \"description\",\n \"individual_id\",\n \"home_phone\"\n from base\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:51.101830Z", "completed_at": "2024-07-23T21:34:52.197697Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.198651Z", "completed_at": "2024-07-23T21:34:52.198655Z"}], "thread_id": "Thread-7", "execution_time": 1.2930412292480469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__opportunity", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n campaign_id\n \n as \n \n campaign_id\n \n, \n \n \n close_date\n \n as \n \n close_date\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n expected_revenue\n \n as \n \n expected_revenue\n \n, \n \n \n fiscal\n \n as \n \n fiscal\n \n, \n \n \n fiscal_quarter\n \n as \n \n fiscal_quarter\n \n, \n \n \n fiscal_year\n \n as \n \n fiscal_year\n \n, \n \n \n forecast_category\n \n as \n \n forecast_category\n \n, \n \n \n forecast_category_name\n \n as \n \n forecast_category_name\n \n, \n \n \n has_open_activity\n \n as \n \n has_open_activity\n \n, \n \n \n has_opportunity_line_item\n \n as \n \n has_opportunity_line_item\n \n, \n \n \n has_overdue_task\n \n as \n \n has_overdue_task\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_won\n \n as \n \n is_won\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n next_step\n \n as \n \n next_step\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n probability\n \n as \n \n probability\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n stage_name\n \n as \n \n stage_name\n \n, \n \n \n synced_quote_id\n \n as \n \n synced_quote_id\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CampaignId\n \n , \n cast(null as timestamp) as \n \n CloseDate\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as numeric(28,6)) as \n \n ExpectedRevenue\n \n , \n cast(null as integer) as \n \n FiscalQuarter\n \n , \n cast(null as integer) as \n \n FiscalYear\n \n , \n cast(null as TEXT) as \n \n ForecastCategory\n \n , \n cast(null as TEXT) as \n \n ForecastCategoryName\n \n , \n cast(null as boolean) as \n \n HasOpenActivity\n \n , \n cast(null as boolean) as \n \n HasOpportunityLineItem\n \n , \n cast(null as boolean) as \n \n HasOverdueTask\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsWon\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n NextStep\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n StageName\n \n , \n cast(null as TEXT) as \n \n SyncedQuoteId\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_opportunity_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n cast(Amount as numeric(28,6)) as amount,\n \n\n\n\n coalesce(cast(CampaignId as TEXT),\n cast(campaign_id as TEXT))\n as campaign_id,\n \n\n\n\n coalesce(cast(CloseDate as timestamp),\n cast(close_date as timestamp))\n as close_date,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as opportunity_description,\n \n\n\n\n coalesce(cast(ExpectedRevenue as numeric(28,6)),\n cast(expected_revenue as numeric(28,6)))\n as expected_revenue,\n \n\n\n\n cast(Fiscal as TEXT) as fiscal,\n \n\n\n\n coalesce(cast(FiscalQuarter as integer),\n cast(fiscal_quarter as integer))\n as fiscal_quarter,\n \n\n\n\n coalesce(cast(FiscalYear as integer),\n cast(fiscal_year as integer))\n as fiscal_year,\n \n\n\n\n coalesce(cast(ForecastCategory as TEXT),\n cast(forecast_category as TEXT))\n as forecast_category,\n \n\n\n\n coalesce(cast(ForecastCategoryName as TEXT),\n cast(forecast_category_name as TEXT))\n as forecast_category_name,\n \n\n\n\n coalesce(cast(HasOpenActivity as boolean),\n cast(has_open_activity as boolean))\n as has_open_activity,\n \n\n\n\n coalesce(cast(HasOpportunityLineItem as boolean),\n cast(has_opportunity_line_item as boolean))\n as has_opportunity_line_item,\n \n\n\n\n coalesce(cast(HasOverdueTask as boolean),\n cast(has_overdue_task as boolean))\n as has_overdue_task,\n \n\n\n\n cast(Id as TEXT) as opportunity_id,\n \n\n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsWon as boolean),\n cast(is_won as boolean))\n as is_won,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n\n cast(Name as TEXT) as opportunity_name,\n \n\n\n\n coalesce(cast(NextStep as TEXT),\n cast(next_step as TEXT))\n as next_step,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Probability as float) as probability,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n coalesce(cast(StageName as TEXT),\n cast(stage_name as TEXT))\n as stage_name,\n \n\n\n\n coalesce(cast(SyncedQuoteId as TEXT),\n cast(synced_quote_id as TEXT))\n as synced_quote_id,\n \n\n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n), \n\ncalculated as (\n \n select \n *,\n created_date >= date_trunc('month', \n current_timestamp::timestamp\n) as is_created_this_month,\n created_date >= date_trunc('quarter', \n current_timestamp::timestamp\n) as is_created_this_quarter,\n \n ((created_date)::date - (\n current_timestamp::timestamp\n)::date)\n as days_since_created,\n \n ((created_date)::date - (close_date)::date)\n as days_to_close,\n date_trunc('month', close_date) = date_trunc('month', \n current_timestamp::timestamp\n) as is_closed_this_month,\n date_trunc('quarter', close_date) = date_trunc('quarter', \n current_timestamp::timestamp\n) as is_closed_this_quarter\n from final\n)\n\nselect * \nfrom calculated\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:51.052807Z", "completed_at": "2024-07-23T21:34:52.198165Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.217020Z", "completed_at": "2024-07-23T21:34:52.217050Z"}], "thread_id": "Thread-5", "execution_time": 1.3147478103637695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__event", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__event_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n activity_date_time\n \n as \n \n activity_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n end_date_time\n \n as \n \n end_date_time\n \n, \n \n \n event_subtype\n \n as \n \n event_subtype\n \n, \n \n \n group_event_type\n \n as \n \n group_event_type\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_child\n \n as \n \n is_child\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_group_event\n \n as \n \n is_group_event\n \n, \n \n \n is_recurrence\n \n as \n \n is_recurrence\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n location\n \n as \n \n location\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n start_date_time\n \n as \n \n start_date_time\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as timestamp) as \n \n ActivityDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as timestamp) as \n \n EndDateTime\n \n , \n cast(null as TEXT) as \n \n EventSubtype\n \n , \n cast(null as TEXT) as \n \n GroupEventType\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsChild\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsGroupEvent\n \n , \n cast(null as boolean) as \n \n IsRecurrence\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as timestamp) as \n \n StartDateTime\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_event_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as event_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n\n coalesce(cast(ActivityDateTime as timestamp),\n cast(activity_date_time as timestamp))\n as activity_date_time,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as event_description,\n \n\n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n\n coalesce(cast(EndDateTime as timestamp),\n cast(end_date_time as timestamp))\n as end_date_time,\n \n\n\n\n coalesce(cast(EventSubtype as TEXT),\n cast(event_subtype as TEXT))\n as event_subtype,\n \n\n\n\n coalesce(cast(GroupEventType as TEXT),\n cast(group_event_type as TEXT))\n as group_event_type,\n \n\n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n\n coalesce(cast(IsChild as boolean),\n cast(is_child as boolean))\n as is_child,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsGroupEvent as boolean),\n cast(is_group_event as boolean))\n as is_group_event,\n \n\n\n\n coalesce(cast(IsRecurrence as boolean),\n cast(is_recurrence as boolean))\n as is_recurrence,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n cast(Location as TEXT) as location,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n coalesce(cast(StartDateTime as timestamp),\n cast(start_date_time as timestamp))\n as start_date_time,\n \n\n\n\n cast(Subject as TEXT) as subject,\n \n\n\n\n cast(Type as TEXT) as type,\n \n\n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:51.026342Z", "completed_at": "2024-07-23T21:34:52.234442Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.234729Z", "completed_at": "2024-07-23T21:34:52.234734Z"}], "thread_id": "Thread-3", "execution_time": 1.3464961051940918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__contact", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n home_phone\n \n as \n \n home_phone\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n lead_source\n \n as \n \n lead_source\n \n, \n \n \n mailing_city\n \n as \n \n mailing_city\n \n, \n \n \n mailing_country\n \n as \n \n mailing_country\n \n, \n \n \n mailing_country_code\n \n as \n \n mailing_country_code\n \n, \n \n \n mailing_postal_code\n \n as \n \n mailing_postal_code\n \n, \n \n \n mailing_state\n \n as \n \n mailing_state\n \n, \n \n \n mailing_state_code\n \n as \n \n mailing_state_code\n \n, \n \n \n mailing_street\n \n as \n \n mailing_street\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n mobile_phone\n \n as \n \n mobile_phone\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n phone\n \n as \n \n phone\n \n, \n \n \n reports_to_id\n \n as \n \n reports_to_id\n \n, \n \n \n title\n \n as \n \n title\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n HomePhone\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n LeadSource\n \n , \n cast(null as TEXT) as \n \n MailingCity\n \n , \n cast(null as TEXT) as \n \n MailingCountry\n \n , \n cast(null as TEXT) as \n \n MailingCountryCode\n \n , \n cast(null as TEXT) as \n \n MailingPostalCode\n \n , \n cast(null as TEXT) as \n \n MailingState\n \n , \n cast(null as TEXT) as \n \n MailingStateCode\n \n , \n cast(null as TEXT) as \n \n MailingStreet\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as TEXT) as \n \n MobilePhone\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ReportsToId\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_contact_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as contact_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n cast(Department as TEXT) as department,\n \n\n\n\n cast(Description as TEXT) as contact_description,\n \n\n\n\n cast(Email as TEXT) as email,\n \n\n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n\n coalesce(cast(HomePhone as TEXT),\n cast(home_phone as TEXT))\n as home_phone,\n \n\n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(LeadSource as TEXT),\n cast(lead_source as TEXT))\n as lead_source,\n \n\n\n\n coalesce(cast(MailingCity as TEXT),\n cast(mailing_city as TEXT))\n as mailing_city,\n \n\n\n\n coalesce(cast(MailingCountry as TEXT),\n cast(mailing_country as TEXT))\n as mailing_country,\n \n\n\n\n coalesce(cast(MailingCountryCode as TEXT),\n cast(mailing_country_code as TEXT))\n as mailing_country_code,\n \n\n\n\n coalesce(cast(MailingPostalCode as TEXT),\n cast(mailing_postal_code as TEXT))\n as mailing_postal_code,\n \n\n\n\n coalesce(cast(MailingState as TEXT),\n cast(mailing_state as TEXT))\n as mailing_state,\n \n\n\n\n coalesce(cast(MailingStateCode as TEXT),\n cast(mailing_state_code as TEXT))\n as mailing_state_code,\n \n\n\n\n coalesce(cast(MailingStreet as TEXT),\n cast(mailing_street as TEXT))\n as mailing_street,\n \n\n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n\n coalesce(cast(MobilePhone as TEXT),\n cast(mobile_phone as TEXT))\n as mobile_phone,\n \n\n\n\n cast(Name as TEXT) as contact_name,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Phone as TEXT) as phone,\n \n\n\n\n coalesce(cast(ReportsToId as TEXT),\n cast(reports_to_id as TEXT))\n as reports_to_id,\n \n\n\n\n cast(Title as TEXT) as title\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:50.943698Z", "completed_at": "2024-07-23T21:34:52.198396Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.218048Z", "completed_at": "2024-07-23T21:34:52.218052Z"}], "thread_id": "Thread-1", "execution_time": 1.3507568836212158, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__account", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_number\n \n as \n \n account_number\n \n, \n \n \n account_source\n \n as \n \n account_source\n \n, \n \n \n annual_revenue\n \n as \n \n annual_revenue\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n industry\n \n as \n \n industry\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_activity_date\n \n as \n \n last_activity_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n master_record_id\n \n as \n \n master_record_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_employees\n \n as \n \n number_of_employees\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n ownership\n \n as \n \n ownership\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n rating\n \n as \n \n rating\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n website\n \n as \n \n website\n \n, \n cast(null as TEXT) as \n \n AccountNumber\n \n , \n cast(null as TEXT) as \n \n AccountSource\n \n , \n cast(null as float) as \n \n AnnualRevenue\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as timestamp) as \n \n LastActivityDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n MasterRecordId\n \n , \n cast(null as integer) as \n \n NumberOfEmployees\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n ParentId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_account_data\"\n), \n\nfinal as (\n select\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(AccountNumber as TEXT),\n cast(account_number as TEXT))\n as account_number,\n \n\n\n\n coalesce(cast(AccountSource as TEXT),\n cast(account_source as TEXT))\n as account_source,\n \n\n\n\n coalesce(cast(AnnualRevenue as numeric(28,6)),\n cast(annual_revenue as numeric(28,6)))\n as annual_revenue,\n \n\n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n\n cast(Description as TEXT) as account_description,\n \n\n\n\n cast(Id as TEXT) as account_id,\n \n\n\n\n cast(Industry as TEXT) as industry,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastActivityDate as timestamp),\n cast(last_activity_date as timestamp))\n as last_activity_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(MasterRecordId as TEXT),\n cast(master_record_id as TEXT))\n as master_record_id,\n \n\n\n\n cast(Name as TEXT) as account_name,\n \n\n\n\n coalesce(cast(NumberOfEmployees as integer),\n cast(number_of_employees as integer))\n as number_of_employees,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Ownership as TEXT) as ownership,\n \n\n\n\n coalesce(cast(ParentId as TEXT),\n cast(parent_id as TEXT))\n as parent_id,\n \n\n\n\n cast(Rating as TEXT) as rating,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n\n cast(Type as TEXT) as type,\n \n\n\n\n cast(Website as TEXT) as website\n\n \n\n\n\n\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.323894Z", "completed_at": "2024-07-23T21:34:52.325096Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.327374Z", "completed_at": "2024-07-23T21:34:52.327380Z"}], "thread_id": "Thread-3", "execution_time": 0.03543972969055176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_account_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.325390Z", "completed_at": "2024-07-23T21:34:52.326678Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.327810Z", "completed_at": "2024-07-23T21:34:52.327819Z"}], "thread_id": "Thread-1", "execution_time": 0.03536415100097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_account_history_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.330548Z", "completed_at": "2024-07-23T21:34:52.332439Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.334313Z", "completed_at": "2024-07-23T21:34:52.334317Z"}], "thread_id": "Thread-3", "execution_time": 0.004802227020263672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_contact_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.332694Z", "completed_at": "2024-07-23T21:34:52.334023Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.334700Z", "completed_at": "2024-07-23T21:34:52.334703Z"}], "thread_id": "Thread-1", "execution_time": 0.004882097244262695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_contact_history_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.336277Z", "completed_at": "2024-07-23T21:34:52.337488Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.339057Z", "completed_at": "2024-07-23T21:34:52.339060Z"}], "thread_id": "Thread-3", "execution_time": 0.003615856170654297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_event_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.337723Z", "completed_at": "2024-07-23T21:34:52.338851Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.339392Z", "completed_at": "2024-07-23T21:34:52.339395Z"}], "thread_id": "Thread-1", "execution_time": 0.00372314453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_lead_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.341301Z", "completed_at": "2024-07-23T21:34:52.342619Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.344720Z", "completed_at": "2024-07-23T21:34:52.344726Z"}], "thread_id": "Thread-3", "execution_time": 0.0044291019439697266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_opportunity_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.342946Z", "completed_at": "2024-07-23T21:34:52.344375Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.345209Z", "completed_at": "2024-07-23T21:34:52.345215Z"}], "thread_id": "Thread-1", "execution_time": 0.0045928955078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_opportunity_history_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.346961Z", "completed_at": "2024-07-23T21:34:52.348898Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.350567Z", "completed_at": "2024-07-23T21:34:52.350570Z"}], "thread_id": "Thread-3", "execution_time": 0.004503011703491211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_opportunity_line_item_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.349130Z", "completed_at": "2024-07-23T21:34:52.350324Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.350929Z", "completed_at": "2024-07-23T21:34:52.350931Z"}], "thread_id": "Thread-1", "execution_time": 0.004601955413818359, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_order_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.352834Z", "completed_at": "2024-07-23T21:34:52.354389Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.356058Z", "completed_at": "2024-07-23T21:34:52.356064Z"}], "thread_id": "Thread-3", "execution_time": 0.004221916198730469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_product_2_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.354655Z", "completed_at": "2024-07-23T21:34:52.355835Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.356460Z", "completed_at": "2024-07-23T21:34:52.356463Z"}], "thread_id": "Thread-1", "execution_time": 0.004288911819458008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_task_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.358053Z", "completed_at": "2024-07-23T21:34:52.359218Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.361629Z", "completed_at": "2024-07-23T21:34:52.361635Z"}], "thread_id": "Thread-3", "execution_time": 0.00444793701171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_user_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.359423Z", "completed_at": "2024-07-23T21:34:52.361345Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.362059Z", "completed_at": "2024-07-23T21:34:52.362063Z"}], "thread_id": "Thread-1", "execution_time": 0.00465083122253418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.salesforce_integration_tests.sf_user_role_data", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.372066Z", "completed_at": "2024-07-23T21:34:52.381738Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.381987Z", "completed_at": "2024-07-23T21:34:52.381993Z"}], "thread_id": "Thread-1", "execution_time": 0.018804073333740234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__opportunity_history_opportunity_id___fivetran_start___fivetran_end.1209811435", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n opportunity_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\n group by opportunity_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.383070Z", "completed_at": "2024-07-23T21:34:52.389122Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.389346Z", "completed_at": "2024-07-23T21:34:52.389355Z"}], "thread_id": "Thread-1", "execution_time": 0.006794929504394531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.390379Z", "completed_at": "2024-07-23T21:34:52.394753Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.394997Z", "completed_at": "2024-07-23T21:34:52.395003Z"}], "thread_id": "Thread-1", "execution_time": 0.0051310062408447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.011954Z", "completed_at": "2024-07-23T21:34:52.939967Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.940568Z", "completed_at": "2024-07-23T21:34:52.940577Z"}], "thread_id": "Thread-8", "execution_time": 1.0717461109161377, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__opportunity_line_item", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__opportunity_line_item_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n discount\n \n as \n \n discount\n \n, \n \n \n has_quantity_schedule\n \n as \n \n has_quantity_schedule\n \n, \n \n \n has_revenue_schedule\n \n as \n \n has_revenue_schedule\n \n, \n \n \n has_schedule\n \n as \n \n has_schedule\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n list_price\n \n as \n \n list_price\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n pricebook_entry_id\n \n as \n \n pricebook_entry_id\n \n, \n \n \n product_2_id\n \n as \n \n product_2_id\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity\n \n as \n \n quantity\n \n, \n \n \n service_date\n \n as \n \n service_date\n \n, \n \n \n sort_order\n \n as \n \n sort_order\n \n, \n \n \n total_price\n \n as \n \n total_price\n \n, \n \n \n unit_price\n \n as \n \n unit_price\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n HasQuantitySchedule\n \n , \n cast(null as boolean) as \n \n HasRevenueSchedule\n \n , \n cast(null as boolean) as \n \n HasSchedule\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as float) as \n \n ListPrice\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n PricebookEntryId\n \n , \n cast(null as TEXT) as \n \n Product2Id\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as timestamp) as \n \n ServiceDate\n \n , \n cast(null as integer) as \n \n SortOrder\n \n , \n cast(null as float) as \n \n TotalPrice\n \n , \n cast(null as float) as \n \n UnitPrice\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_opportunity_line_item_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as opportunity_line_item_id,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as opportunity_line_item_description,\n \n\n\n\n cast(Discount as float) as discount,\n \n\n\n\n coalesce(cast(HasQuantitySchedule as boolean),\n cast(has_quantity_schedule as boolean))\n as has_quantity_schedule,\n \n\n\n\n coalesce(cast(HasRevenueSchedule as boolean),\n cast(has_revenue_schedule as boolean))\n as has_revenue_schedule,\n \n\n\n\n coalesce(cast(HasSchedule as boolean),\n cast(has_schedule as boolean))\n as has_schedule,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(ListPrice as numeric(28,6)),\n cast(list_price as numeric(28,6)))\n as list_price,\n \n\n\n\n cast(Name as TEXT) as opportunity_line_item_name,\n \n\n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n\n coalesce(cast(PricebookEntryId as TEXT),\n cast(pricebook_entry_id as TEXT))\n as pricebook_entry_id,\n \n\n\n\n coalesce(cast(Product2Id as TEXT),\n cast(product_2_id as TEXT))\n as product_2_id,\n \n\n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n\n cast(Quantity as float) as quantity,\n \n\n\n\n coalesce(cast(ServiceDate as timestamp),\n cast(service_date as timestamp))\n as service_date,\n \n\n\n\n coalesce(cast(SortOrder as integer),\n cast(sort_order as integer))\n as sort_order,\n \n\n\n\n coalesce(cast(TotalPrice as numeric(28,6)),\n cast(total_price as numeric(28,6)))\n as total_price,\n \n\n\n\n coalesce(cast(UnitPrice as numeric(28,6)),\n cast(unit_price as numeric(28,6)))\n as unit_price\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.030408Z", "completed_at": "2024-07-23T21:34:52.940317Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:52.940864Z", "completed_at": "2024-07-23T21:34:52.940867Z"}], "thread_id": "Thread-2", "execution_time": 1.0728580951690674, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__order", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__order_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activated_by_id\n \n as \n \n activated_by_id\n \n, \n \n \n activated_date\n \n as \n \n activated_date\n \n, \n \n \n billing_city\n \n as \n \n billing_city\n \n, \n \n \n billing_country\n \n as \n \n billing_country\n \n, \n \n \n billing_country_code\n \n as \n \n billing_country_code\n \n, \n \n \n billing_postal_code\n \n as \n \n billing_postal_code\n \n, \n \n \n billing_state\n \n as \n \n billing_state\n \n, \n \n \n billing_state_code\n \n as \n \n billing_state_code\n \n, \n \n \n billing_street\n \n as \n \n billing_street\n \n, \n \n \n contract_id\n \n as \n \n contract_id\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n end_date\n \n as \n \n end_date\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n opportunity_id\n \n as \n \n opportunity_id\n \n, \n \n \n order_number\n \n as \n \n order_number\n \n, \n \n \n original_order_id\n \n as \n \n original_order_id\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n pricebook_2_id\n \n as \n \n pricebook_2_id\n \n, \n \n \n shipping_city\n \n as \n \n shipping_city\n \n, \n \n \n shipping_country\n \n as \n \n shipping_country\n \n, \n \n \n shipping_country_code\n \n as \n \n shipping_country_code\n \n, \n \n \n shipping_postal_code\n \n as \n \n shipping_postal_code\n \n, \n \n \n shipping_state\n \n as \n \n shipping_state\n \n, \n \n \n shipping_state_code\n \n as \n \n shipping_state_code\n \n, \n \n \n shipping_street\n \n as \n \n shipping_street\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n total_amount\n \n as \n \n total_amount\n \n, \n \n \n type\n \n as \n \n type\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n ActivatedById\n \n , \n cast(null as timestamp) as \n \n ActivatedDate\n \n , \n cast(null as TEXT) as \n \n BillingCity\n \n , \n cast(null as TEXT) as \n \n BillingCountry\n \n , \n cast(null as TEXT) as \n \n BillingCountryCode\n \n , \n cast(null as TEXT) as \n \n BillingPostalCode\n \n , \n cast(null as TEXT) as \n \n BillingState\n \n , \n cast(null as TEXT) as \n \n BillingStateCode\n \n , \n cast(null as TEXT) as \n \n BillingStreet\n \n , \n cast(null as TEXT) as \n \n ContractId\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as timestamp) as \n \n EndDate\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n OpportunityId\n \n , \n cast(null as TEXT) as \n \n OrderNumber\n \n , \n cast(null as TEXT) as \n \n OriginalOrderId\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n Pricebook2Id\n \n , \n cast(null as TEXT) as \n \n ShippingCity\n \n , \n cast(null as TEXT) as \n \n ShippingCountry\n \n , \n cast(null as TEXT) as \n \n ShippingCountryCode\n \n , \n cast(null as TEXT) as \n \n ShippingPostalCode\n \n , \n cast(null as TEXT) as \n \n ShippingState\n \n , \n cast(null as TEXT) as \n \n ShippingStateCode\n \n , \n cast(null as TEXT) as \n \n ShippingStreet\n \n , \n cast(null as float) as \n \n TotalAmount\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_order_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as order_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n coalesce(cast(ActivatedById as TEXT),\n cast(activated_by_id as TEXT))\n as activated_by_id,\n \n\n\n\n coalesce(cast(ActivatedDate as timestamp),\n cast(activated_date as timestamp))\n as activated_date,\n \n\n\n\n coalesce(cast(BillingCity as TEXT),\n cast(billing_city as TEXT))\n as billing_city,\n \n\n\n\n coalesce(cast(BillingCountry as TEXT),\n cast(billing_country as TEXT))\n as billing_country,\n \n\n\n\n coalesce(cast(BillingCountryCode as TEXT),\n cast(billing_country_code as TEXT))\n as billing_country_code,\n \n\n\n\n coalesce(cast(BillingPostalCode as TEXT),\n cast(billing_postal_code as TEXT))\n as billing_postal_code,\n \n\n\n\n coalesce(cast(BillingState as TEXT),\n cast(billing_state as TEXT))\n as billing_state,\n \n\n\n\n coalesce(cast(BillingStateCode as TEXT),\n cast(billing_state_code as TEXT))\n as billing_state_code,\n \n\n\n\n coalesce(cast(BillingStreet as TEXT),\n cast(billing_street as TEXT))\n as billing_street,\n \n\n\n\n coalesce(cast(ContractId as TEXT),\n cast(contract_id as TEXT))\n as contract_id,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as order_description,\n \n\n\n\n coalesce(cast(EndDate as timestamp),\n cast(end_date as timestamp))\n as end_date,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(OpportunityId as TEXT),\n cast(opportunity_id as TEXT))\n as opportunity_id,\n \n\n\n\n coalesce(cast(OrderNumber as TEXT),\n cast(order_number as TEXT))\n as order_number,\n \n\n\n\n coalesce(cast(OriginalOrderId as TEXT),\n cast(original_order_id as TEXT))\n as original_order_id,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n coalesce(cast(Pricebook2Id as TEXT),\n cast(pricebook_2_id as TEXT))\n as pricebook_2_id,\n \n\n\n\n coalesce(cast(ShippingCity as TEXT),\n cast(shipping_city as TEXT))\n as shipping_city,\n \n\n\n\n coalesce(cast(ShippingCountry as TEXT),\n cast(shipping_country as TEXT))\n as shipping_country,\n \n\n\n\n coalesce(cast(ShippingCountryCode as TEXT),\n cast(shipping_country_code as TEXT))\n as shipping_country_code,\n \n\n\n\n coalesce(cast(ShippingPostalCode as TEXT),\n cast(shipping_postal_code as TEXT))\n as shipping_postal_code,\n \n\n\n\n coalesce(cast(ShippingState as TEXT),\n cast(shipping_state as TEXT))\n as shipping_state,\n \n\n\n\n coalesce(cast(ShippingStateCode as TEXT),\n cast(shipping_state_code as TEXT))\n as shipping_state_code,\n \n\n\n\n coalesce(cast(ShippingStreet as TEXT),\n cast(shipping_street as TEXT))\n as shipping_street,\n \n\n\n\n cast(Status as TEXT) as status,\n \n\n\n\n coalesce(cast(TotalAmount as numeric(28,6)),\n cast(total_amount as numeric(28,6)))\n as total_amount,\n \n\n\n\n cast(Type as TEXT) as type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__order\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.090325Z", "completed_at": "2024-07-23T21:34:53.100484Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.100990Z", "completed_at": "2024-07-23T21:34:53.101004Z"}], "thread_id": "Thread-8", "execution_time": 0.013204097747802734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__account_history_account_id___fivetran_start___fivetran_end.7db755dfc6", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n account_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\n group by account_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.096143Z", "completed_at": "2024-07-23T21:34:53.102660Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.107438Z", "completed_at": "2024-07-23T21:34:53.107451Z"}], "thread_id": "Thread-2", "execution_time": 0.019047975540161133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\nwhere history_unique_key is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.103019Z", "completed_at": "2024-07-23T21:34:53.122910Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.123792Z", "completed_at": "2024-07-23T21:34:53.123801Z"}], "thread_id": "Thread-8", "execution_time": 0.02187180519104004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__account_history_history_unique_key.c378da769f", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.125994Z", "completed_at": "2024-07-23T21:34:53.129768Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.130010Z", "completed_at": "2024-07-23T21:34:53.130016Z"}], "thread_id": "Thread-8", "execution_time": 0.0047740936279296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect lead_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\nwhere lead_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.131409Z", "completed_at": "2024-07-23T21:34:53.135222Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.135444Z", "completed_at": "2024-07-23T21:34:53.135449Z"}], "thread_id": "Thread-8", "execution_time": 0.004770755767822266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__lead_lead_id.ba8b21e282", "compiled": true, "compiled_code": "\n \n \n\nselect\n lead_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\nwhere lead_id is not null\ngroup by lead_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.198889Z", "completed_at": "2024-07-23T21:34:53.087176Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.088965Z", "completed_at": "2024-07-23T21:34:53.088975Z"}], "thread_id": "Thread-6", "execution_time": 0.9864170551300049, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__product_2", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__product_2_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n display_url\n \n as \n \n display_url\n \n, \n \n \n external_id\n \n as \n \n external_id\n \n, \n \n \n family\n \n as \n \n family\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n number_of_quantity_installments\n \n as \n \n number_of_quantity_installments\n \n, \n \n \n number_of_revenue_installments\n \n as \n \n number_of_revenue_installments\n \n, \n \n \n product_code\n \n as \n \n product_code\n \n, \n \n \n quantity_installment_period\n \n as \n \n quantity_installment_period\n \n, \n \n \n quantity_schedule_type\n \n as \n \n quantity_schedule_type\n \n, \n \n \n quantity_unit_of_measure\n \n as \n \n quantity_unit_of_measure\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n revenue_installment_period\n \n as \n \n revenue_installment_period\n \n, \n \n \n revenue_schedule_type\n \n as \n \n revenue_schedule_type\n \n, \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as TEXT) as \n \n DisplayUrl\n \n , \n cast(null as TEXT) as \n \n ExternalId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as integer) as \n \n NumberOfQuantityInstallments\n \n , \n cast(null as integer) as \n \n NumberOfRevenueInstallments\n \n , \n cast(null as TEXT) as \n \n ProductCode\n \n , \n cast(null as TEXT) as \n \n QuantityInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n QuantityScheduleType\n \n , \n cast(null as TEXT) as \n \n QuantityUnitOfMeasure\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n RevenueInstallmentPeriod\n \n , \n cast(null as TEXT) as \n \n RevenueScheduleType\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_product_2_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as product_2_id,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as product_2_description,\n \n\n\n\n coalesce(cast(DisplayUrl as TEXT),\n cast(display_url as TEXT))\n as display_url,\n \n\n\n\n coalesce(cast(ExternalId as TEXT),\n cast(external_id as TEXT))\n as external_id,\n \n\n\n\n cast(Family as TEXT) as family,\n \n\n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n cast(Name as TEXT) as product_2_name,\n \n\n\n\n coalesce(cast(NumberOfQuantityInstallments as integer),\n cast(number_of_quantity_installments as integer))\n as number_of_quantity_installments,\n \n\n\n\n coalesce(cast(NumberOfRevenueInstallments as integer),\n cast(number_of_revenue_installments as integer))\n as number_of_revenue_installments,\n \n\n\n\n coalesce(cast(ProductCode as TEXT),\n cast(product_code as TEXT))\n as product_code,\n \n\n\n\n coalesce(cast(QuantityInstallmentPeriod as TEXT),\n cast(quantity_installment_period as TEXT))\n as quantity_installment_period,\n \n\n\n\n coalesce(cast(QuantityScheduleType as TEXT),\n cast(quantity_schedule_type as TEXT))\n as quantity_schedule_type,\n \n\n\n\n coalesce(cast(QuantityUnitOfMeasure as TEXT),\n cast(quantity_unit_of_measure as TEXT))\n as quantity_unit_of_measure,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n coalesce(cast(RevenueInstallmentPeriod as TEXT),\n cast(revenue_installment_period as TEXT))\n as revenue_installment_period,\n \n\n\n\n coalesce(cast(RevenueScheduleType as TEXT),\n cast(revenue_schedule_type as TEXT))\n as revenue_schedule_type\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.192241Z", "completed_at": "2024-07-23T21:34:53.196355Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.196726Z", "completed_at": "2024-07-23T21:34:53.196733Z"}], "thread_id": "Thread-6", "execution_time": 0.005995035171508789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.dbt_utils_unique_combination_of_columns_stg_salesforce__contact_history_contact_id___fivetran_start___fivetran_end.2d7ff092ee", "compiled": true, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n contact_id, _fivetran_start, _fivetran_end\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\n group by contact_id, _fivetran_start, _fivetran_end\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.198045Z", "completed_at": "2024-07-23T21:34:53.201015Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.201225Z", "completed_at": "2024-07-23T21:34:53.201229Z"}], "thread_id": "Thread-6", "execution_time": 0.0038080215454101562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect history_unique_key\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.202477Z", "completed_at": "2024-07-23T21:34:53.205817Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.206018Z", "completed_at": "2024-07-23T21:34:53.206021Z"}], "thread_id": "Thread-6", "execution_time": 0.004203081130981445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_history_history_unique_key.215181e10d", "compiled": true, "compiled_code": "\n \n \n\nselect\n history_unique_key as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\nwhere history_unique_key is not null\ngroup by history_unique_key\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.207375Z", "completed_at": "2024-07-23T21:34:53.210724Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.210969Z", "completed_at": "2024-07-23T21:34:53.210976Z"}], "thread_id": "Thread-6", "execution_time": 0.004400014877319336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__event_event_id.e964b30db8", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\"\nwhere event_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.212249Z", "completed_at": "2024-07-23T21:34:53.215441Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.215634Z", "completed_at": "2024-07-23T21:34:53.215639Z"}], "thread_id": "Thread-6", "execution_time": 0.0039899349212646484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.216891Z", "completed_at": "2024-07-23T21:34:53.221110Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.221343Z", "completed_at": "2024-07-23T21:34:53.221353Z"}], "thread_id": "Thread-6", "execution_time": 0.0051729679107666016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__event_event_id.13f7c8c0d9", "compiled": true, "compiled_code": "\n \n \n\nselect\n event_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\"\nwhere event_id is not null\ngroup by event_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.293187Z", "completed_at": "2024-07-23T21:34:53.190607Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.191577Z", "completed_at": "2024-07-23T21:34:53.191580Z"}], "thread_id": "Thread-7", "execution_time": 0.9754378795623779, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__user", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n alias\n \n as \n \n alias\n \n, \n \n \n city\n \n as \n \n city\n \n, \n \n \n company_name\n \n as \n \n company_name\n \n, \n \n \n contact_id\n \n as \n \n contact_id\n \n, \n \n \n country\n \n as \n \n country\n \n, \n \n \n country_code\n \n as \n \n country_code\n \n, \n \n \n department\n \n as \n \n department\n \n, \n \n \n email\n \n as \n \n email\n \n, \n \n \n first_name\n \n as \n \n first_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n individual_id\n \n as \n \n individual_id\n \n, \n \n \n is_active\n \n as \n \n is_active\n \n, \n \n \n last_login_date\n \n as \n \n last_login_date\n \n, \n \n \n last_name\n \n as \n \n last_name\n \n, \n \n \n last_referenced_date\n \n as \n \n last_referenced_date\n \n, \n \n \n last_viewed_date\n \n as \n \n last_viewed_date\n \n, \n \n \n manager_id\n \n as \n \n manager_id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n postal_code\n \n as \n \n postal_code\n \n, \n \n \n profile_id\n \n as \n \n profile_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n state_code\n \n as \n \n state_code\n \n, \n \n \n street\n \n as \n \n street\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n user_role_id\n \n as \n \n user_role_id\n \n, \n \n \n user_type\n \n as \n \n user_type\n \n, \n \n \n username\n \n as \n \n username\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as TEXT) as \n \n CompanyName\n \n , \n cast(null as TEXT) as \n \n ContactId\n \n , \n cast(null as TEXT) as \n \n CountryCode\n \n , \n cast(null as TEXT) as \n \n FirstName\n \n , \n cast(null as TEXT) as \n \n IndividualId\n \n , \n cast(null as boolean) as \n \n IsActive\n \n , \n cast(null as timestamp) as \n \n LastLoginDate\n \n , \n cast(null as TEXT) as \n \n LastName\n \n , \n cast(null as timestamp) as \n \n LastReferencedDate\n \n , \n cast(null as timestamp) as \n \n LastViewedDate\n \n , \n cast(null as TEXT) as \n \n ManagerId\n \n , \n cast(null as TEXT) as \n \n PostalCode\n \n , \n cast(null as TEXT) as \n \n ProfileId\n \n , \n cast(null as TEXT) as \n \n StateCode\n \n , \n cast(null as TEXT) as \n \n UserRoleId\n \n , \n cast(null as TEXT) as \n \n UserType\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_user_data\"\n), \n\nfinal as (\n \n select \n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n cast(Alias as TEXT) as alias,\n \n\n\n\n cast(City as TEXT) as city,\n \n\n\n\n coalesce(cast(CompanyName as TEXT),\n cast(company_name as TEXT))\n as company_name,\n \n\n\n\n coalesce(cast(ContactId as TEXT),\n cast(contact_id as TEXT))\n as contact_id,\n \n\n\n\n cast(Country as TEXT) as country,\n \n\n\n\n coalesce(cast(CountryCode as TEXT),\n cast(country_code as TEXT))\n as country_code,\n \n\n\n\n cast(Department as TEXT) as department,\n \n\n\n\n cast(Email as TEXT) as email,\n \n\n\n\n coalesce(cast(FirstName as TEXT),\n cast(first_name as TEXT))\n as first_name,\n \n\n\n\n cast(Id as TEXT) as user_id,\n \n\n\n\n coalesce(cast(IndividualId as TEXT),\n cast(individual_id as TEXT))\n as individual_id,\n \n\n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n\n coalesce(cast(LastLoginDate as timestamp),\n cast(last_login_date as timestamp))\n as last_login_date,\n \n\n\n\n coalesce(cast(LastName as TEXT),\n cast(last_name as TEXT))\n as last_name,\n \n\n\n\n coalesce(cast(LastReferencedDate as timestamp),\n cast(last_referenced_date as timestamp))\n as last_referenced_date,\n \n\n\n\n coalesce(cast(LastViewedDate as timestamp),\n cast(last_viewed_date as timestamp))\n as last_viewed_date,\n \n\n\n\n coalesce(cast(ManagerId as TEXT),\n cast(manager_id as TEXT))\n as manager_id,\n \n\n\n\n cast(Name as TEXT) as user_name,\n \n\n\n\n coalesce(cast(PostalCode as TEXT),\n cast(postal_code as TEXT))\n as postal_code,\n \n\n\n\n coalesce(cast(ProfileId as TEXT),\n cast(profile_id as TEXT))\n as profile_id,\n \n\n\n\n cast(State as TEXT) as state,\n \n\n\n\n coalesce(cast(StateCode as TEXT),\n cast(state_code as TEXT))\n as state_code,\n \n\n\n\n cast(Street as TEXT) as street,\n \n\n\n\n cast(Title as TEXT) as title,\n \n\n\n\n coalesce(cast(UserRoleId as TEXT),\n cast(user_role_id as TEXT))\n as user_role_id,\n \n\n\n\n coalesce(cast(UserType as TEXT),\n cast(user_type as TEXT))\n as user_type,\n \n\n\n\n cast(Username as TEXT) as username\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect * \nfrom final", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.313830Z", "completed_at": "2024-07-23T21:34:53.190288Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.191358Z", "completed_at": "2024-07-23T21:34:53.191363Z"}], "thread_id": "Thread-5", "execution_time": 0.9756217002868652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__user_role", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__user_role_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n developer_name\n \n as \n \n developer_name\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n opportunity_access_for_account_owner\n \n as \n \n opportunity_access_for_account_owner\n \n, \n \n \n parent_role_id\n \n as \n \n parent_role_id\n \n, \n \n \n rollup_description\n \n as \n \n rollup_description\n \n, \n cast(null as TEXT) as \n \n DeveloperName\n \n , \n cast(null as TEXT) as \n \n OpportunityAccessForAccountOwner\n \n , \n cast(null as TEXT) as \n \n ParentRoleId\n \n , \n cast(null as TEXT) as \n \n RollupDescription\n \n \n\n\n\n from \"postgres\".\"zz_salesforce\".\"sf_user_role_data\"\n), \n\nfinal as (\n\n select\n _fivetran_deleted,\n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n coalesce(cast(DeveloperName as TEXT),\n cast(developer_name as TEXT))\n as developer_name,\n \n\n\n\n cast(Id as TEXT) as user_role_id,\n \n\n\n\n cast(Name as TEXT) as user_role_name,\n \n\n\n\n coalesce(cast(OpportunityAccessForAccountOwner as TEXT),\n cast(opportunity_access_for_account_owner as TEXT))\n as opportunity_access_for_account_owner,\n \n\n\n\n coalesce(cast(ParentRoleId as TEXT),\n cast(parent_role_id as TEXT))\n as parent_role_id,\n \n\n\n\n coalesce(cast(RollupDescription as TEXT),\n cast(rollup_description as TEXT))\n as rollup_description\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.265863Z", "completed_at": "2024-07-23T21:34:53.191127Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.191982Z", "completed_at": "2024-07-23T21:34:53.191986Z"}], "thread_id": "Thread-4", "execution_time": 1.0026118755340576, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce_source.stg_salesforce__task", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__task_enabled variable within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n _fivetran_active\n \n as \n \n _fivetran_active\n \n, \n \n \n account_id\n \n as \n \n account_id\n \n, \n \n \n activity_date\n \n as \n \n activity_date\n \n, \n \n \n call_disposition\n \n as \n \n call_disposition\n \n, \n \n \n call_duration_in_seconds\n \n as \n \n call_duration_in_seconds\n \n, \n \n \n call_object\n \n as \n \n call_object\n \n, \n \n \n call_type\n \n as \n \n call_type\n \n, \n \n \n completed_date_time\n \n as \n \n completed_date_time\n \n, \n \n \n created_by_id\n \n as \n \n created_by_id\n \n, \n \n \n created_date\n \n as \n \n created_date\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_archived\n \n as \n \n is_archived\n \n, \n \n \n is_closed\n \n as \n \n is_closed\n \n, \n \n \n is_deleted\n \n as \n \n is_deleted\n \n, \n \n \n is_high_priority\n \n as \n \n is_high_priority\n \n, \n \n \n last_modified_by_id\n \n as \n \n last_modified_by_id\n \n, \n \n \n last_modified_date\n \n as \n \n last_modified_date\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n priority\n \n as \n \n priority\n \n, \n \n \n record_type_id\n \n as \n \n record_type_id\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n subject\n \n as \n \n subject\n \n, \n \n \n task_subtype\n \n as \n \n task_subtype\n \n, \n \n \n type\n \n as \n \n type\n \n, \n \n \n what_count\n \n as \n \n what_count\n \n, \n \n \n what_id\n \n as \n \n what_id\n \n, \n \n \n who_count\n \n as \n \n who_count\n \n, \n \n \n who_id\n \n as \n \n who_id\n \n, \n cast(null as TEXT) as \n \n AccountId\n \n , \n cast(null as timestamp) as \n \n ActivityDate\n \n , \n cast(null as TEXT) as \n \n CallDisposition\n \n , \n cast(null as integer) as \n \n CallDurationInSeconds\n \n , \n cast(null as TEXT) as \n \n CallObject\n \n , \n cast(null as TEXT) as \n \n CallType\n \n , \n cast(null as timestamp) as \n \n CompletedDateTime\n \n , \n cast(null as TEXT) as \n \n CreatedById\n \n , \n cast(null as timestamp) as \n \n CreatedDate\n \n , \n cast(null as boolean) as \n \n IsArchived\n \n , \n cast(null as boolean) as \n \n IsClosed\n \n , \n cast(null as boolean) as \n \n IsDeleted\n \n , \n cast(null as boolean) as \n \n IsHighPriority\n \n , \n cast(null as TEXT) as \n \n LastModifiedById\n \n , \n cast(null as timestamp) as \n \n LastModifiedDate\n \n , \n cast(null as TEXT) as \n \n OwnerId\n \n , \n cast(null as TEXT) as \n \n RecordTypeId\n \n , \n cast(null as TEXT) as \n \n TaskSubtype\n \n , \n cast(null as integer) as \n \n WhatCount\n \n , \n cast(null as TEXT) as \n \n WhatId\n \n , \n cast(null as integer) as \n \n WhoCount\n \n , \n cast(null as TEXT) as \n \n WhoId\n \n \n\n\n \n from \"postgres\".\"zz_salesforce\".\"sf_task_data\"\n), \n\nfinal as (\n \n select \n cast(_fivetran_synced as timestamp) as _fivetran_synced,\n \n\n\n\n cast(Id as TEXT) as task_id,\n \n\n\n\n coalesce(cast(AccountId as TEXT),\n cast(account_id as TEXT))\n as account_id,\n \n\n\n\n coalesce(cast(ActivityDate as timestamp),\n cast(activity_date as timestamp))\n as activity_date,\n \n\n\n\n coalesce(cast(CallDisposition as TEXT),\n cast(call_disposition as TEXT))\n as call_disposition,\n \n\n\n\n coalesce(cast(CallDurationInSeconds as integer),\n cast(call_duration_in_seconds as integer))\n as call_duration_in_seconds,\n \n\n\n\n coalesce(cast(CallObject as TEXT),\n cast(call_object as TEXT))\n as call_object,\n \n\n\n\n coalesce(cast(CallType as TEXT),\n cast(call_type as TEXT))\n as call_type,\n \n\n\n\n coalesce(cast(CompletedDateTime as timestamp),\n cast(completed_date_time as timestamp))\n as completed_date_time,\n \n\n\n\n coalesce(cast(CreatedById as TEXT),\n cast(created_by_id as TEXT))\n as created_by_id,\n \n\n\n\n coalesce(cast(CreatedDate as timestamp),\n cast(created_date as timestamp))\n as created_date,\n \n\n\n\n cast(Description as TEXT) as task_description,\n \n\n\n\n coalesce(cast(IsArchived as boolean),\n cast(is_archived as boolean))\n as is_archived,\n \n\n\n\n coalesce(cast(IsClosed as boolean),\n cast(is_closed as boolean))\n as is_closed,\n \n\n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n\n coalesce(cast(IsHighPriority as boolean),\n cast(is_high_priority as boolean))\n as is_high_priority,\n \n\n\n\n coalesce(cast(LastModifiedById as TEXT),\n cast(last_modified_by_id as TEXT))\n as last_modified_by_id,\n \n\n\n\n coalesce(cast(LastModifiedDate as timestamp),\n cast(last_modified_date as timestamp))\n as last_modified_date,\n \n\n\n\n coalesce(cast(OwnerId as TEXT),\n cast(owner_id as TEXT))\n as owner_id,\n \n\n\n\n cast(Priority as TEXT) as priority,\n \n\n\n\n coalesce(cast(RecordTypeId as TEXT),\n cast(record_type_id as TEXT))\n as record_type_id,\n \n\n\n\n cast(Status as TEXT) as status,\n \n\n\n\n cast(Subject as TEXT) as subject,\n \n\n\n\n coalesce(cast(TaskSubtype as TEXT),\n cast(task_subtype as TEXT))\n as task_subtype,\n \n\n\n\n cast(Type as TEXT) as type,\n \n\n\n\n coalesce(cast(WhatCount as integer),\n cast(what_count as integer))\n as what_count,\n \n\n\n\n coalesce(cast(WhatId as TEXT),\n cast(what_id as TEXT))\n as what_id,\n \n\n\n\n coalesce(cast(WhoCount as integer),\n cast(who_count as integer))\n as who_count,\n \n\n\n\n coalesce(cast(WhoId as TEXT),\n cast(who_id as TEXT))\n as who_id\n \n \n\n\n\n\n \n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.222627Z", "completed_at": "2024-07-23T21:34:53.270293Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.271439Z", "completed_at": "2024-07-23T21:34:53.271445Z"}], "thread_id": "Thread-6", "execution_time": 0.04941082000732422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.272236Z", "completed_at": "2024-07-23T21:34:53.285452Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.285706Z", "completed_at": "2024-07-23T21:34:53.285713Z"}], "thread_id": "Thread-7", "execution_time": 0.015774011611938477, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"\nwhere contact_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.278775Z", "completed_at": "2024-07-23T21:34:53.286437Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.287250Z", "completed_at": "2024-07-23T21:34:53.287256Z"}], "thread_id": "Thread-4", "execution_time": 0.016493797302246094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__account_account_id.1e0ff361d4", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\nwhere account_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.275579Z", "completed_at": "2024-07-23T21:34:53.286688Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.287684Z", "completed_at": "2024-07-23T21:34:53.287688Z"}], "thread_id": "Thread-5", "execution_time": 0.01714015007019043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__contact_contact_id.0cc2c0609e", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.282468Z", "completed_at": "2024-07-23T21:34:53.288033Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.288996Z", "completed_at": "2024-07-23T21:34:53.289000Z"}], "thread_id": "Thread-6", "execution_time": 0.0072100162506103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__account_account_id.6d58a39ba7", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\nwhere account_id is not null\ngroup by account_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.289352Z", "completed_at": "2024-07-23T21:34:53.301093Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.301683Z", "completed_at": "2024-07-23T21:34:53.301690Z"}], "thread_id": "Thread-7", "execution_time": 0.01485300064086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.298315Z", "completed_at": "2024-07-23T21:34:53.305456Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.306209Z", "completed_at": "2024-07-23T21:34:53.306215Z"}], "thread_id": "Thread-5", "execution_time": 0.012634038925170898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__order_order_id.4782f3b34f", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__order\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.294976Z", "completed_at": "2024-07-23T21:34:53.305682Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.306594Z", "completed_at": "2024-07-23T21:34:53.306597Z"}], "thread_id": "Thread-4", "execution_time": 0.013379096984863281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.302142Z", "completed_at": "2024-07-23T21:34:53.307723Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.315112Z", "completed_at": "2024-07-23T21:34:53.315119Z"}], "thread_id": "Thread-6", "execution_time": 0.02046799659729004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__order_order_id.12a96b4e3c", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__order\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.307995Z", "completed_at": "2024-07-23T21:34:53.328023Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.328446Z", "completed_at": "2024-07-23T21:34:53.328455Z"}], "thread_id": "Thread-7", "execution_time": 0.022610187530517578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__opportunity_line_item_enhanced", "compiled": true, "compiled_code": "--This model will only run if you have the underlying opportunity line item table.\n\nwith opportunity_line_item as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_line_item\"\n),\n\n-- If using product_2 table, the following will be included, otherwise it will not.\n\nproduct_2 as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"\n),\n\n\n\nfinal as (\n\n select\n oli.opportunity_line_item_id,\n oli.opportunity_line_item_name,\n oli.opportunity_line_item_description,\n oli.opportunity_id,\n row_number() over (partition by oli.opportunity_id order by oli.created_date) as line_item_index,\n count(opportunity_line_item_id) over (partition by oli.opportunity_id) as total_line_items,\n oli.created_date,\n oli.last_modified_date,\n oli.service_date,\n oli.pricebook_entry_id,\n oli.product_2_id,\n oli.list_price,\n oli.quantity,\n oli.unit_price,\n oli.total_price,\n oli.has_quantity_schedule,\n oli.has_revenue_schedule\n\n \n ,\n product_2.product_2_name,\n product_2.product_code,\n product_2.product_2_description,\n product_2.external_id as product_external_id,\n product_2.family as product_family,\n product_2.is_active as product_is_active,\n product_2.is_archived as product_is_archived,\n product_2.is_deleted as product_is_deleted,\n product_2.number_of_quantity_installments as product_number_of_quantity_installments,\n product_2.quantity_installment_period as product_quantity_installment_period,\n product_2.quantity_schedule_type as product_quantity_schedule_type,\n product_2.quantity_unit_of_measure as product_quantity_unit_of_measure,\n product_2.number_of_revenue_installments as product_number_of_revenue_installments,\n product_2.revenue_installment_period as product_revenue_installment_period,\n product_2.revenue_schedule_type as product_revenue_schedule_type\n \n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n \n \n\n\n\n\n \n\n from opportunity_line_item as oli\n\n \n left join product_2\n on oli.product_2_id = product_2.product_2_id\n \n)\n\nselect * \nfrom final", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.316222Z", "completed_at": "2024-07-23T21:34:53.329567Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.330363Z", "completed_at": "2024-07-23T21:34:53.330368Z"}], "thread_id": "Thread-5", "execution_time": 0.01584482192993164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect product_2_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"\nwhere product_2_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.320190Z", "completed_at": "2024-07-23T21:34:53.329809Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.330978Z", "completed_at": "2024-07-23T21:34:53.330981Z"}], "thread_id": "Thread-4", "execution_time": 0.0161590576171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__product_2_product_2_id.b4bc489d61", "compiled": true, "compiled_code": "\n \n \n\nselect\n product_2_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__product_2\"\nwhere product_2_id is not null\ngroup by product_2_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.323887Z", "completed_at": "2024-07-23T21:34:53.330767Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.334632Z", "completed_at": "2024-07-23T21:34:53.334636Z"}], "thread_id": "Thread-6", "execution_time": 0.011595964431762695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__contact_enhanced", "compiled": true, "compiled_code": "with contact as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact\"\n), \n\naccount as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n)\n\nselect \n contact.contact_id,\n contact.contact_name,\n contact.account_id,\n contact.department,\n contact.contact_description,\n contact.email,\n contact.individual_id,\n contact.is_deleted as contact_is_deleted,\n contact.last_activity_date,\n contact.lead_source,\n contact.mailing_city,\n contact.mailing_country,\n contact.mailing_country_code,\n contact.mailing_postal_code,\n contact.mailing_state,\n contact.mailing_state_code,\n contact.mailing_street,\n contact.master_record_id,\n contact.mobile_phone,\n contact.owner_id as contact_owner_id,\n contact.phone,\n contact.reports_to_id,\n salesforce_user.user_name as contact_owner_name,\n account.account_name,\n account.account_number,\n account.account_source,\n account.annual_revenue as account_annual_revenue,\n account.account_description,\n account.industry as account_industry,\n account.is_deleted as account_is_deleted,\n account.number_of_employees as account_number_of_employees,\n account.owner_id as account_owner_id,\n account.parent_id as account_parent_id,\n account.rating as account_rating,\n account.type as account_type\n\n --The below scripts allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\nfrom contact\nleft join account \n on contact.account_id = account.account_id\nleft join salesforce_user\n on contact.owner_id = salesforce_user.user_id", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_enhanced\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.331344Z", "completed_at": "2024-07-23T21:34:53.336333Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.337283Z", "completed_at": "2024-07-23T21:34:53.337290Z"}], "thread_id": "Thread-7", "execution_time": 0.008061885833740234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_user_id.ac0ab26d65", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\nwhere user_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.337674Z", "completed_at": "2024-07-23T21:34:53.356889Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.357138Z", "completed_at": "2024-07-23T21:34:53.357145Z"}], "thread_id": "Thread-5", "execution_time": 0.021855831146240234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__user_user_id.9a29b41152", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.340822Z", "completed_at": "2024-07-23T21:34:53.361125Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.361751Z", "completed_at": "2024-07-23T21:34:53.361758Z"}], "thread_id": "Thread-4", "execution_time": 0.02577495574951172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__opportunity_enhanced", "compiled": true, "compiled_code": "with opportunity as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\n), \n\n\naccount as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account\"\n), \n\nadd_fields as (\n\n select \n opportunity.*,\n account.account_number,\n account.account_source,\n account.industry,\n account.account_name,\n account.number_of_employees,\n account.type as account_type,\n opportunity_owner.user_id as opportunity_owner_id,\n opportunity_owner.user_name as opportunity_owner_name,\n opportunity_owner.user_role_id as opportunity_owner_role_id,\n opportunity_owner.city opportunity_owner_city,\n opportunity_owner.state as opportunity_owner_state,\n opportunity_manager.user_id as opportunity_manager_id,\n opportunity_manager.user_name as opportunity_manager_name,\n opportunity_manager.city opportunity_manager_city,\n opportunity_manager.state as opportunity_manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as opportunity_owner_position, \n user_role.developer_name as opportunity_owner_developer_name,\n user_role.parent_role_id as opportunity_owner_parent_role_id,\n user_role.rollup_description as opportunity_owner_rollup_description,\n \n\n case\n when opportunity.is_won then 'Won'\n when not opportunity.is_won and opportunity.is_closed then 'Lost'\n when not opportunity.is_closed and lower(opportunity.forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status,\n case when is_created_this_month then amount else 0 end as created_amount_this_month,\n case when is_created_this_quarter then amount else 0 end as created_amount_this_quarter,\n case when is_created_this_month then 1 else 0 end as created_count_this_month,\n case when is_created_this_quarter then 1 else 0 end as created_count_this_quarter,\n case when is_closed_this_month then amount else 0 end as closed_amount_this_month,\n case when is_closed_this_quarter then amount else 0 end as closed_amount_this_quarter,\n case when is_closed_this_month then 1 else 0 end as closed_count_this_month,\n case when is_closed_this_quarter then 1 else 0 end as closed_count_this_quarter\n\n --The below script allows for pass through columns.\n \n\n\n\n\n \n\n\n\n\n \n\n\n\n\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n \n\n\n\n\n \n\n from opportunity\n left join account \n on opportunity.account_id = account.account_id\n left join salesforce_user as opportunity_owner \n on opportunity.owner_id = opportunity_owner.user_id\n left join salesforce_user as opportunity_manager \n on opportunity_owner.manager_id = opportunity_manager.user_id\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n left join user_role \n on opportunity_owner.user_role_id = user_role.user_role_id\n \n)\n\nselect *\nfrom add_fields", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.349831Z", "completed_at": "2024-07-23T21:34:53.361415Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.362218Z", "completed_at": "2024-07-23T21:34:53.362222Z"}], "thread_id": "Thread-6", "execution_time": 0.025494098663330078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__task_task_id.aabe11a5d9", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect task_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"\nwhere task_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.353536Z", "completed_at": "2024-07-23T21:34:53.362621Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.363715Z", "completed_at": "2024-07-23T21:34:53.363718Z"}], "thread_id": "Thread-7", "execution_time": 0.010946035385131836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect user_role_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\nwhere user_role_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.358225Z", "completed_at": "2024-07-23T21:34:53.363466Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.364667Z", "completed_at": "2024-07-23T21:34:53.364672Z"}], "thread_id": "Thread-5", "execution_time": 0.006939888000488281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__task_task_id.73684ed605", "compiled": true, "compiled_code": "\n \n \n\nselect\n task_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"\nwhere task_id is not null\ngroup by task_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.366452Z", "completed_at": "2024-07-23T21:34:53.380336Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.380570Z", "completed_at": "2024-07-23T21:34:53.380576Z"}], "thread_id": "Thread-4", "execution_time": 0.01656508445739746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce_source.unique_stg_salesforce__user_role_user_role_id.1259050718", "compiled": true, "compiled_code": "\n \n \n\nselect\n user_role_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\nwhere user_role_id is not null\ngroup by user_role_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.369607Z", "completed_at": "2024-07-23T21:34:53.384300Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.384579Z", "completed_at": "2024-07-23T21:34:53.384587Z"}], "thread_id": "Thread-6", "execution_time": 0.02032327651977539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.d1357e96aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_line_item_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.374348Z", "completed_at": "2024-07-23T21:34:53.385964Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.389175Z", "completed_at": "2024-07-23T21:34:53.389182Z"}], "thread_id": "Thread-7", "execution_time": 0.023086071014404297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__opportunity_line_item_enhanced_opportunity_line_item_id.3d5a350c32", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_line_item_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_line_item_enhanced\"\nwhere opportunity_line_item_id is not null\ngroup by opportunity_line_item_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.377172Z", "completed_at": "2024-07-23T21:34:53.389634Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.390421Z", "completed_at": "2024-07-23T21:34:53.390425Z"}], "thread_id": "Thread-5", "execution_time": 0.016972064971923828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.381610Z", "completed_at": "2024-07-23T21:34:53.389862Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.390807Z", "completed_at": "2024-07-23T21:34:53.390810Z"}], "thread_id": "Thread-4", "execution_time": 0.009662866592407227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_enhanced\"\nwhere contact_id is not null\ngroup by contact_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.386209Z", "completed_at": "2024-07-23T21:34:53.391430Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.392379Z", "completed_at": "2024-07-23T21:34:53.392382Z"}], "thread_id": "Thread-6", "execution_time": 0.0070383548736572266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\nsalesforce_user as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n), \n\nbooking_by_owner as (\n\n select \n opportunity_manager_id as b_manager_id,\n opportunity_owner_id as b_owner_id,\n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n group by 1, 2\n), \n\nlost_by_owner as (\n\n select \n opportunity_manager_id as l_manager_id,\n opportunity_owner_id as l_owner_id,\n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n group by 1, 2\n), \n\npipeline_by_owner as (\n\n select \n opportunity_manager_id as p_manager_id,\n opportunity_owner_id as p_owner_id,\n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n group by 1, 2\n)\n\nselect \n salesforce_user.user_id as owner_id,\n coalesce(p_manager_id, b_manager_id, l_manager_id) as manager_id,\n booking_by_owner.*,\n lost_by_owner.*,\n pipeline_by_owner.*\nfrom salesforce_user\nleft join booking_by_owner \n on booking_by_owner.b_owner_id = salesforce_user.user_id\nleft join lost_by_owner \n on lost_by_owner.l_owner_id = salesforce_user.user_id\nleft join pipeline_by_owner \n on pipeline_by_owner.p_owner_id = salesforce_user.user_id", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.393254Z", "completed_at": "2024-07-23T21:34:53.404311Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.408589Z", "completed_at": "2024-07-23T21:34:53.408599Z"}], "thread_id": "Thread-7", "execution_time": 0.017499923706054688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__sales_snapshot", "compiled": true, "compiled_code": "with salesforce_opportunity_enhanced as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\npipeline as (\n\n select \n round(sum(created_amount_this_month)) as pipeline_created_amount_this_month,\n round(sum(created_amount_this_quarter)) as pipeline_created_amount_this_quarter,\n round(sum(created_amount_this_month * probability)) as pipeline_created_forecast_amount_this_month,\n round(sum(created_amount_this_quarter * probability)) as pipeline_created_forecast_amount_this_quarter,\n sum(created_count_this_month) as pipeline_count_created_this_month,\n sum(created_count_this_quarter) as pipeline_count_created_this_quarter,\n count(*) as total_number_pipeline,\n round(sum(amount)) as total_pipeline_amount,\n round(sum(amount * probability)) as total_pipeline_forecast_amount,\n round(avg(amount)) as avg_pipeline_opp_amount,\n max(amount) as largest_deal_in_pipeline,\n avg(days_since_created) as avg_days_open\n from salesforce_opportunity_enhanced\n where status = 'Pipeline'\n), \n\nbookings as (\n\n select \n round(sum(closed_amount_this_month)) as bookings_amount_closed_this_month,\n round(sum(closed_amount_this_quarter)) as bookings_amount_closed_this_quarter,\n count(*) as total_number_bookings,\n round(sum(amount)) as total_bookings_amount,\n sum(closed_count_this_month) as bookings_count_closed_this_month,\n sum(closed_count_this_quarter) as bookings_count_closed_this_quarter,\n round(avg(amount)) as avg_bookings_amount,\n max(amount) as largest_booking,\n avg(days_to_close) as avg_days_to_close\n from salesforce_opportunity_enhanced\n where status = 'Won'\n), \n\nlost as (\n\n select \n round(sum(closed_amount_this_month)) as lost_amount_this_month,\n round(sum(closed_amount_this_quarter)) as lost_amount_this_quarter,\n count(*) as total_number_lost,\n round(sum(amount)) as total_lost_amount,\n sum(closed_count_this_month) as lost_count_this_month,\n sum(closed_count_this_quarter) as lost_count_this_quarter\n from salesforce_opportunity_enhanced\n where status = 'Lost'\n)\n\nselect \n bookings.*,\n pipeline.*,\n lost.*,\n case \n when (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) = 0 then null\n else round( (bookings.bookings_amount_closed_this_month / (bookings.bookings_amount_closed_this_month + lost.lost_amount_this_month) ) * 100, 2 )\n end as win_percent_this_month,\n case \n when (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) = 0 then null\n else round( (bookings.bookings_amount_closed_this_quarter / (bookings.bookings_amount_closed_this_quarter + lost.lost_amount_this_quarter) ) * 100, 2 ) \n end as win_percent_this_quarter,\n case \n when (bookings.total_bookings_amount + lost.total_lost_amount) = 0 then null \n else round( (bookings.total_bookings_amount / (bookings.total_bookings_amount + lost.total_lost_amount) ) * 100, 2) \n end as total_win_percent\nfrom bookings, pipeline, lost", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__sales_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.397729Z", "completed_at": "2024-07-23T21:34:53.409149Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.409940Z", "completed_at": "2024-07-23T21:34:53.409944Z"}], "thread_id": "Thread-5", "execution_time": 0.017251968383789062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__opportunity_enhanced_opportunity_id.0faefe3afc", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.400911Z", "completed_at": "2024-07-23T21:34:53.409398Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.410374Z", "completed_at": "2024-07-23T21:34:53.410378Z"}], "thread_id": "Thread-4", "execution_time": 0.01742100715637207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__opportunity_enhanced_opportunity_id.fb4f6a1788", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_enhanced\"\nwhere opportunity_id is not null\ngroup by opportunity_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.404592Z", "completed_at": "2024-07-23T21:34:53.411033Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.411641Z", "completed_at": "2024-07-23T21:34:53.411645Z"}], "thread_id": "Thread-6", "execution_time": 0.01116490364074707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__manager_performance", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\"\n), \n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nuser_role as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user_role\"\n),\n\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n)\n\nselect \n coalesce(manager.user_id, 'No Manager Assigned') as manager_id,\n coalesce(manager.user_name, 'No Manager Assigned') as manager_name,\n manager.city as manager_city,\n manager.state as manager_state,\n\n -- If using user_role table, the following will be included, otherwise it will not.\n \n user_role.user_role_name as manager_position,\n \n\n count(distinct owner_id) as number_of_direct_reports,\n coalesce(sum(bookings_amount_closed_this_month), 0) as bookings_amount_closed_this_month,\n coalesce(sum(bookings_amount_closed_this_quarter), 0) as bookings_amount_closed_this_quarter,\n coalesce(sum(total_number_bookings), 0) as total_number_bookings,\n coalesce(sum(total_bookings_amount), 0) as total_bookings_amount,\n coalesce(sum(bookings_count_closed_this_month), 0) as bookings_count_closed_this_month,\n coalesce(sum(bookings_count_closed_this_quarter), 0) as bookings_count_closed_this_quarter,\n coalesce(max(largest_booking), 0) as largest_booking,\n coalesce(sum(lost_amount_this_month), 0) as lost_amount_this_month,\n coalesce(sum(lost_amount_this_quarter), 0) as lost_amount_this_quarter,\n coalesce(sum(total_number_lost), 0) as total_number_lost,\n coalesce(sum(total_lost_amount), 0) as total_lost_amount,\n coalesce(sum(lost_count_this_month), 0) as lost_count_this_month,\n coalesce(sum(lost_count_this_quarter), 0) as lost_count_this_quarter,\n coalesce(sum(pipeline_created_amount_this_month), 0) as pipeline_created_amount_this_month,\n coalesce(sum(pipeline_created_amount_this_quarter), 0) as pipeline_created_amount_this_quarter,\n coalesce(sum(pipeline_created_forecast_amount_this_month), 0) as pipeline_created_forecast_amount_this_month,\n coalesce(sum(pipeline_created_forecast_amount_this_quarter), 0) as pipeline_created_forecast_amount_this_quarter,\n coalesce(sum(pipeline_count_created_this_month), 0) as pipeline_count_created_this_month,\n coalesce(sum(pipeline_count_created_this_quarter), 0) as pipeline_count_created_this_quarter,\n coalesce(sum(total_number_pipeline), 0) as total_number_pipeline,\n coalesce(sum(total_pipeline_amount), 0) as total_pipeline_amount,\n coalesce(sum(total_pipeline_forecast_amount), 0) as total_pipeline_forecast_amount,\n coalesce(max(largest_deal_in_pipeline), 0) as largest_deal_in_pipeline,\n round(case \n when sum(bookings_amount_closed_this_month + lost_amount_this_month) > 0 then\n sum(bookings_amount_closed_this_month) / sum(bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0\n end, 2) as win_percent_this_month,\n round(case\n when sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 then\n sum(bookings_amount_closed_this_quarter) / sum(bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0\n end, 2) as win_percent_this_quarter,\n round(case\n when sum(total_bookings_amount + total_lost_amount) > 0 then\n sum(total_bookings_amount) / sum(total_bookings_amount + total_lost_amount) * 100\n else 0\n end, 2) as total_win_percent\n\nfrom opportunity_aggregation_by_owner\nleft join salesforce_user as manager\n on manager.user_id = opportunity_aggregation_by_owner.manager_id\n\n-- If using user_role table, the following will be included, otherwise it will not.\n\nleft join user_role\n on manager.user_role_id = user_role.user_role_id\n\ngroup by 1, 2, 3, 4, 5\n\n\n\nhaving count(distinct owner_id) > 0", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__manager_performance\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.412030Z", "completed_at": "2024-07-23T21:34:53.415979Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.417043Z", "completed_at": "2024-07-23T21:34:53.417049Z"}], "thread_id": "Thread-7", "execution_time": 0.006325960159301758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__owner_performance", "compiled": true, "compiled_code": "with opportunity_aggregation_by_owner as (\n \n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\" \n), \n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__user\"\n)\n\nselect \n opportunity_aggregation_by_owner.*,\n salesforce_user.user_name as owner_name,\n salesforce_user.city as owner_city,\n salesforce_user.state as owner_state,\n case \n when (bookings_amount_closed_this_month + lost_amount_this_month) > 0 \n then bookings_amount_closed_this_month / (bookings_amount_closed_this_month + lost_amount_this_month) * 100\n else 0 \n end as win_percent_this_month,\n case \n when (bookings_amount_closed_this_quarter + lost_amount_this_quarter) > 0 \n then bookings_amount_closed_this_quarter / (bookings_amount_closed_this_quarter + lost_amount_this_quarter) * 100\n else 0 \n end as win_percent_this_quarter,\n case \n when (total_bookings_amount + total_lost_amount) > 0 \n then total_bookings_amount / (total_bookings_amount + total_lost_amount) * 100\n else 0 \n end as total_win_percent\nfrom opportunity_aggregation_by_owner\njoin salesforce_user \n on salesforce_user.user_id = opportunity_aggregation_by_owner.owner_id", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__owner_performance\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.428730Z", "completed_at": "2024-07-23T21:34:53.435754Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.440048Z", "completed_at": "2024-07-23T21:34:53.440055Z"}], "thread_id": "Thread-4", "execution_time": 0.02437114715576172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650", "compiled": true, "compiled_code": "\n \n \n\nselect\n manager_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is not null\ngroup by manager_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.417413Z", "completed_at": "2024-07-23T21:34:53.435981Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.440459Z", "completed_at": "2024-07-23T21:34:53.440464Z"}], "thread_id": "Thread-5", "execution_time": 0.02506089210510254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect manager_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__manager_performance\"\nwhere manager_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.436719Z", "completed_at": "2024-07-23T21:34:53.444354Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.444619Z", "completed_at": "2024-07-23T21:34:53.444623Z"}], "thread_id": "Thread-6", "execution_time": 0.009878158569335938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__owner_performance_owner_id.d39bad3ef7", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect owner_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.441056Z", "completed_at": "2024-07-23T21:34:53.445087Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.445294Z", "completed_at": "2024-07-23T21:34:53.445297Z"}], "thread_id": "Thread-7", "execution_time": 0.010190963745117188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__owner_performance_owner_id.b4050dc6e7", "compiled": true, "compiled_code": "\n \n \n\nselect\n owner_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__owner_performance\"\nwhere owner_id is not null\ngroup by owner_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.363923Z", "completed_at": "2024-07-23T21:34:53.439820Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.443825Z", "completed_at": "2024-07-23T21:34:53.443831Z"}], "thread_id": "Thread-3", "execution_time": 1.140949010848999, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__opportunity_daily_history", "compiled": true, "compiled_code": "\n\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1665\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-23'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\nopportunity_history as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, opportunity_id\n order by _fivetran_start desc) as row_num \n from opportunity_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.opportunity_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as opportunity_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_history", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_daily_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:52.396166Z", "completed_at": "2024-07-23T21:34:53.436210Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.440823Z", "completed_at": "2024-07-23T21:34:53.440826Z"}], "thread_id": "Thread-1", "execution_time": 1.1087417602539062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__account_daily_history", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1665\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-23'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\naccount_history as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__account_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, account_id\n order by _fivetran_start desc) as row_num \n from account_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.account_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as account_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_history", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__account_daily_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.507906Z", "completed_at": "2024-07-23T21:34:53.523256Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.523633Z", "completed_at": "2024-07-23T21:34:53.523640Z"}], "thread_id": "Thread-4", "execution_time": 0.018019914627075195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__opportunity_daily_history_opportunity_day_id.d442dbd660", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect opportunity_day_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.516506Z", "completed_at": "2024-07-23T21:34:53.524158Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.524405Z", "completed_at": "2024-07-23T21:34:53.524409Z"}], "thread_id": "Thread-6", "execution_time": 0.01737236976623535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__account_daily_history_account_day_id.acb64a70cb", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect account_day_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.513319Z", "completed_at": "2024-07-23T21:34:53.524977Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.525286Z", "completed_at": "2024-07-23T21:34:53.525294Z"}], "thread_id": "Thread-5", "execution_time": 0.01883697509765625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__opportunity_daily_history_opportunity_day_id.1176a99849", "compiled": true, "compiled_code": "\n \n \n\nselect\n opportunity_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__opportunity_daily_history\"\nwhere opportunity_day_id is not null\ngroup by opportunity_day_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.519728Z", "completed_at": "2024-07-23T21:34:53.525702Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.525998Z", "completed_at": "2024-07-23T21:34:53.526002Z"}], "thread_id": "Thread-7", "execution_time": 0.01868271827697754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581", "compiled": true, "compiled_code": "\n \n \n\nselect\n account_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__account_daily_history\"\nwhere account_day_id is not null\ngroup by account_day_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.109236Z", "completed_at": "2024-07-23T21:34:53.980600Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:53.981159Z", "completed_at": "2024-07-23T21:34:53.981167Z"}], "thread_id": "Thread-2", "execution_time": 0.9766688346862793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.int_salesforce__date_spine", "compiled": true, "compiled_code": "-- depends_on: \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\n \nwith spine as (\n\n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 31\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2024-06-23' as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= \n\n cast('2024-07-23' as date) + ((interval '1 day') * (1))\n\n\n\n)\n\nselect * from filtered\n\n\n)\n\nselect * \nfrom spine", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__date_spine\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:54.087389Z", "completed_at": "2024-07-23T21:34:54.104280Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:54.104657Z", "completed_at": "2024-07-23T21:34:54.104665Z"}], "thread_id": "Thread-1", "execution_time": 0.018173933029174805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__daily_activity", "compiled": true, "compiled_code": "with date_spine as (\n \n select \n date_trunc('day', date_day) as date_day\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"int_salesforce__date_spine\"\n),\n\n\ntask as (\n \n select \n date_trunc('day', activity_date) as activity_date,\n count(task_id) as tasks_completed\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__task\"\n group by 1\n), \n\n\n\nsalesforce_event as (\n\n select \n coalesce(date_trunc('day', activity_date), date_trunc('day', activity_date_time)) as activity_date,\n count(event_id) as events_completed\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__event\"\n group by 1\n), \n\n\n\nsalesforce_lead as (\n\n select \n date_trunc('day', created_date) as created_date,\n count(lead_id) as leads_created \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\n group by 1\n), \n\nsalesforce_converted_lead as (\n\n select \n date_trunc('day', converted_date) as converted_date,\n count(lead_id) as leads_converted\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__lead\"\n where is_converted\n group by 1\n), \n\n\nopportunity as (\n\n select \n opportunity_id,\n date_trunc('day', created_date) as created_date,\n account_id,\n date_trunc('day', close_date) as close_date,\n is_closed,\n is_deleted,\n is_won,\n owner_id, \n stage_name,\n type,\n amount,\n case\n when is_won then 'Won'\n when not is_won and is_closed then 'Lost'\n when not is_closed and lower(forecast_category) in ('pipeline','forecast','bestcase') then 'Pipeline'\n else 'Other'\n end as status\n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__opportunity\"\n),\n\nopportunities_created as (\n\n select\n created_date,\n count(opportunity_id) as opportunities_created,\n round(sum(amount)) as opportunities_created_amount\n from opportunity\n group by 1\n),\n\nopportunities_closed as (\n\n select\n close_date,\n count(case when status = 'Won' then opportunity_id else null end) as opportunities_won,\n round(sum(case when status = 'Won' then amount else 0 end)) as opportunities_won_amount,\n count(case when status = 'Lost' then opportunity_id else null end) as opportunities_lost,\n round(sum(case when status = 'Lost' then amount else null end)) as opportunities_lost_amount,\n round(sum(case when status = 'Pipeline' then amount else null end)) as pipeline_amount\n from opportunity\n group by 1\n)\n\nselect\n date_spine.date_day,\n\n \n salesforce_lead.leads_created,\n salesforce_converted_lead.leads_converted,\n \n \n \n task.tasks_completed,\n \n\n \n salesforce_event.events_completed,\n \n\n opportunities_created.opportunities_created,\n opportunities_created.opportunities_created_amount,\n opportunities_closed.opportunities_won,\n opportunities_closed.opportunities_won_amount,\n opportunities_closed.opportunities_lost,\n opportunities_closed.opportunities_lost_amount,\n opportunities_closed.pipeline_amount\nfrom date_spine\n\n\nleft join salesforce_lead\n on date_spine.date_day = salesforce_lead.created_date\nleft join salesforce_converted_lead\n on date_spine.date_day = salesforce_converted_lead.converted_date\n\n\n\nleft join task\n on date_spine.date_day = task.activity_date\n\n\n\nleft join salesforce_event\n on date_spine.date_day = salesforce_event.activity_date\n\n\nleft join opportunities_created\n on date_spine.date_day = opportunities_created.created_date\nleft join opportunities_closed\n on date_spine.date_day = opportunities_closed.close_date", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__daily_activity\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:54.108077Z", "completed_at": "2024-07-23T21:34:54.118711Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:54.119054Z", "completed_at": "2024-07-23T21:34:54.119062Z"}], "thread_id": "Thread-4", "execution_time": 0.0128631591796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:54.114389Z", "completed_at": "2024-07-23T21:34:54.119619Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:54.120184Z", "completed_at": "2024-07-23T21:34:54.120192Z"}], "thread_id": "Thread-6", "execution_time": 0.013499975204467773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__daily_activity\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:53.136751Z", "completed_at": "2024-07-23T21:34:54.093761Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:54.100654Z", "completed_at": "2024-07-23T21:34:54.100671Z"}], "thread_id": "Thread-8", "execution_time": 1.0250649452209473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.salesforce.salesforce__contact_daily_history", "compiled": true, "compiled_code": "\n\n\n \n\n \n\n \n \n\n\nwith spine as (\n \n \n \n\n \n\n\n\n\n\nwith rawdata as (\n\n \n\n \n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n \n p0.generated_number * power(2, 0)\n + \n \n p1.generated_number * power(2, 1)\n + \n \n p2.generated_number * power(2, 2)\n + \n \n p3.generated_number * power(2, 3)\n + \n \n p4.generated_number * power(2, 4)\n + \n \n p5.generated_number * power(2, 5)\n + \n \n p6.generated_number * power(2, 6)\n + \n \n p7.generated_number * power(2, 7)\n + \n \n p8.generated_number * power(2, 8)\n + \n \n p9.generated_number * power(2, 9)\n + \n \n p10.generated_number * power(2, 10)\n \n \n + 1\n as generated_number\n\n from\n\n \n p as p0\n cross join \n \n p as p1\n cross join \n \n p as p2\n cross join \n \n p as p3\n cross join \n \n p as p4\n cross join \n \n p as p5\n cross join \n \n p as p6\n cross join \n \n p as p7\n cross join \n \n p as p8\n cross join \n \n p as p9\n cross join \n \n p as p10\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 1665\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2020-01-01'as date) + ((interval '1 day') * (row_number() over (order by 1) - 1))\n\n\n ) as date_day\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_day <= cast('2024-07-23'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncontact_history as (\n\n select * \n from \"postgres\".\"zz_salesforce_salesforce_dev\".\"stg_salesforce__contact_history\"\n \n),\n\norder_daily_values as (\n\n select \n *,\n row_number() over (\n partition by _fivetran_date, contact_id\n order by _fivetran_start desc) as row_num \n from contact_history \n),\n\nget_latest_daily_value as (\n\n select * \n from order_daily_values\n where row_num = 1\n),\n\ndaily_history as (\n\n select \n md5(cast(coalesce(cast(spine.date_day as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(get_latest_daily_value.contact_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as contact_day_id,\n cast(spine.date_day as date) as date_day,\n get_latest_daily_value.*\n from get_latest_daily_value\n join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as timestamp)\n and get_latest_daily_value._fivetran_end >= cast(spine.date_day as timestamp)\n)\n\nselect * \nfrom daily_history", "relation_name": "\"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_daily_history\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:54.164590Z", "completed_at": "2024-07-23T21:34:54.173214Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:54.173962Z", "completed_at": "2024-07-23T21:34:54.173974Z"}], "thread_id": "Thread-7", "execution_time": 0.011055946350097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.not_null_salesforce__contact_daily_history_contact_day_id.9609d06e52", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect contact_day_id\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-07-23T21:34:54.169086Z", "completed_at": "2024-07-23T21:34:54.173647Z"}, {"name": "execute", "started_at": "2024-07-23T21:34:54.174601Z", "completed_at": "2024-07-23T21:34:54.174606Z"}], "thread_id": "Thread-2", "execution_time": 0.011190652847290039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.salesforce.unique_salesforce__contact_daily_history_contact_day_id.ad49bcb58c", "compiled": true, "compiled_code": "\n \n \n\nselect\n contact_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"zz_salesforce_salesforce_dev\".\"salesforce__contact_daily_history\"\nwhere contact_day_id is not null\ngroup by contact_day_id\nhaving count(*) > 1\n\n\n", "relation_name": null}], "elapsed_time": 5.969184875488281, "args": {"partial_parse": true, "profiles_dir": "/Users/catherinefritz/.dbt", "introspect": true, "strict_mode": false, "log_format_file": "debug", "invocation_command": "dbt docs generate", "log_file_max_bytes": 10485760, "cache_selected_only": false, "write_json": true, "macro_debugging": false, "enable_legacy_logger": false, "send_anonymous_usage_stats": true, "source_freshness_run_project_hooks": false, "use_colors_file": true, "populate_cache": true, "use_colors": true, "log_path": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests/logs", "indirect_selection": "eager", "log_level_file": "debug", "require_resource_names_without_spaces": false, "partial_parse_file_diff": true, "favor_state": false, "static_parser": true, "vars": {}, "require_explicit_package_overrides_for_builtin_materializations": true, "project_dir": "/Users/catherinefritz/Documents/dbt_packages/salesforce/dbt_salesforce/integration_tests", "warn_error_options": {"include": [], "exclude": []}, "empty_catalog": false, "quiet": false, "select": [], "exclude": [], "defer": false, "log_format": "default", "print": true, "version_check": true, "printer_width": 80, "compile": true, "show_resource_report": false, "log_level": "info", "static": false, "which": "generate"}} \ No newline at end of file From bbe56a789a02b856715a58477338cdd8714f2626 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:17:13 -0500 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 348f084..f87ec3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - Updated the logic for model `int_salesforce__date_spine` to reference the `stg_*` staging models instead of the source tables. - This was necessary since the staging models account for multiple spellings of column names while the source tables do not. +## Under the hood +- Added `--depends_on:` comments to `int_salesforce__date_spine` to prevent errors during `dbt run`. +- Added `flags.WHICH in ('run', 'build')` as a condition in `int_salesforce__date_spine` to prevent call statements from querying the staging models during a `dbt compile`. + # dbt_salesforce v1.1.0 [PR #55](https://github.com/fivetran/dbt_salesforce/pull/55) includes the following updates: